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.

Disable focus event that removes default values

  1. I have found a few posts on the support forum that request the feature to remove default values for fields when on focus and that's awesome. But now I have a situation where I want that default value to stay there when the field is in focus.

    Here's my situation. I'm using a Custom Field from the Post Field menu and have specified the field type as Website. I have insert "http://" as the default value so that the user knows they need to include that. However, when the field is in focus that text just disappears anyway and they need to retype it. I want it to stay there so they can just continue typing http://www.abc.com.

    Is there a way to disable this feature? Here's a link to the form in question.
    http://www.actgen.org/bridges-home/post-a-job

    Posted 13 years ago on Wednesday April 20, 2011 | Permalink
  2. Additional... if you go to that page, you'll have to select Apply Online in the how to apply section to see the field in question.

    Posted 13 years ago on Wednesday April 20, 2011 | Permalink
  3. You must have HTML5 turned on in the Gravity Forms Settings. If you have HTML5 turned on then the Website field uses the HTML5 placeholder attribute. This automatically does what you describe above, there is no way to change this behavior. The placeholder attribute acts only as a placeholder and clears on focus automatically. It doesn't retain the placeholder value. It is only intended as a visual guide. You would have to turn HTML5 output off in the Gravity Forms Settings in order for this not to happen.

    Posted 13 years ago on Thursday April 21, 2011 | Permalink
  4. That's odd. I checked and it was set to no (turned off) all along. Any other thoughts?

    Posted 13 years ago on Thursday April 21, 2011 | Permalink
  5. You shouldn't have anything auto-clearing values then if HTML5 is turned off. There is no auto-clear on focus functionality built into Gravity Forms. You must have other code in your theme (or another plugin) that is causing this issue.

    I have narrowed it down to JS in this script that your site is loading:

    http://www.actgen.org/wp-content/themes/thewall/js/library.js

    It contains code that if the field is a text field it auto-clears the value.

    Posted 13 years ago on Thursday April 21, 2011 | Permalink
  6. Thanks so much! Got things working perfectly.

    Posted 13 years ago on Thursday April 21, 2011 | Permalink

This topic has been resolved and has been closed to new replies.