WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
Change Default Placeholder Text (5 posts)

  1. bamajr
    Member
    Posted 2 years ago #

    I am glad to see the contact form addition to JetPack. Great Job!

    What I would like to know is:

    1. Where does the contact form pull its "Placeholder Text" from?
    2. How does one change it?

    Take a look at http://bamajr.com/contact-bamajr/

    I have separate First-Name and Last-Name fields. I would like to be able to give First-Name/Last-Name examples (Placeholders). Instead it is putting my username in both fields, even when I'm not logged into WordPress.

    http://wordpress.org/extend/plugins/jetpack/

  2. Tim Moore
    Moderator
    Plugin Author

    Posted 2 years ago #

    When I look at the page, the fields are empty (which is the intended default if logged out). If you are logged in, it should be pulling your user account information. Could you try a different browser, just to make sure?

    If you'd like to set defaults, you could do something like this:

    [contact-form] [contact-field label="Name" type="name" required="true" default="DEFAULT NAME" /] [contact-field label="Email" type="email" required="true" /] [contact-field label="Website" type="url" /] [contact-field label="Comment" type="textarea" required="true" /] [/contact-form]

    Just add a default="" parameter to each contact-field.

  3. bamajr
    Member
    Posted 2 years ago #

    @ Tim Moore:

    Let me explain the issue a little further.

    My username is "Bamajr" and if I'm logged in, both fields used for FIRST NAME and LAST NAME are populated with Bamajr.

    This is a NAME field, not a username field. So, if a person is logged in why is either field being populated with the username and not FIRST/LAST NAME?

    I think the default parameter may help, but I haven't tried it yet. I'll let you know when I do.

  4. Tim Moore
    Moderator
    Plugin Author

    Posted 2 years ago #

    If you look at http://yourURL.com/wp-admin/profile.php, you'll see that there are four fields for "name":

    • username
    • first name
    • last name
    • nickname

    By default, the contact form is looking at the "nickname" field for a logged in user. I'm guessing that in your case, like mine, it is set at the default, which is for the nickname to be the same as username.

  5. bamajr
    Member
    Posted 2 years ago #

    Ok... The default parameter is a TERRIBLE option!

    [contact-form subject="Bamajr.com Contact Form" to="username@domain.tld"] [contact-field label="First Name" type="name" required="true" default="First Name" /] [contact-field label="Last Name" type="name" required="true" default="First Name" /] [contact-field label="Email" type="email" required="true" default="username@domain.tld" /] [contact-field label="Website" type="url" default="http://www.domain.tld" /] [contact-field label="Message" type="textarea" /] [/contact-form]

    If you use the default parameter like I have shown, the form passes validation and can be sent, without any one actually typing anything into the form.

    There needs to be something like the HTML5 placeholder=" " parameter.

    Oh, and now that the validation can of worms is open... this really needs some customizable validation controls. Blindly accepting form submissions that pass Akismet is a TERRIBLE idea.

    Also, if the profile accepts username, first name, last name and nickname, they should each match up to a "Field Type" within the JetPack form.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags