PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Add JavaScript to fields

  1. Is there any way to insert some JavaScript into a field's tag, i.e. something like this:

    <input id="first_name" maxlength="40" name="first_name" type="text" onblur="if(this.value=='') this.value='Name';" onfocus="if(this.value=='Name') this.value='';" value="Name" />

    As you can see, this puts the field name inside the text box and disappears when someone clicks into that box to enter text.

    Posted 11 years ago on Tuesday March 12, 2013 | Permalink
  2. David Peralty

    No, but you can use a third party add-on like the following to have labels in fields: http://wordpress.org/extend/plugins/gravity-forms-placeholders/

    Posted 11 years ago on Tuesday March 12, 2013 | Permalink