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.

pre-populate value disappears on-click

  1. I may well be missing something, but how can I have a pre-populated field (for want of a better word) reset itself when the user clicks in it.
    Is this: https://www.evernote.com/shard/s3/sh/8285df7d-cebe-47c0-aba7-50e813853e06/3f3d88cdbcfc240498fe7190f644ce83
    The right place to be entering in the text?
    You know what I mean yeah?

    Posted 6 years ago on Sunday April 7, 2013 | Permalink
  2. Richard Vav
    Administrator

    Hi Jason,

    Your link isn't working but what you are describing sounds like the placeholder attribute which was introduced in html5, it disappears when the user starts typing in the field, it's not available out of the box in gravity forms yet, but it can be accomplished by either using a plugin

    http://wordpress.org/extend/plugins/gravity-forms-placeholders/
    http://wordpress.org/extend/plugins/gravity-forms-auto-placeholders/

    or if you only have a few fields a bit of jQuery would accomplish it as well, the following example would add the placeholder Name to field 1 of form 5

    <script>
    $(document).ready(function(){
         $('#input_5_1').attr('placeholder','Name');
    });
    </script>
    Posted 6 years ago on Monday April 8, 2013 | Permalink
  3. I'm having the exact same problem with trying to get the text disappear once clicked.
    I've installed the gravity-forms-placeholders plugin and even added gplaceholder to the CSS Class Name box under the fields advanced tab.
    What am I doing wrong?
    Thank you

    http://photographycentral.com/about/

    Posted 6 years ago on Monday April 8, 2013 | Permalink
  4. Richard Vav
    Administrator

    Jeff, have you also set a default value for that field, it also looks like the field label is empty

    Posted 6 years ago on Monday April 8, 2013 | Permalink
  5. Richard Vav
    Administrator

    Jeff, the placeholder plugin you have installed uses the field label as the placeholder, but the placeholder won't work if you have a default value set, which it appears you have. If you remove the default value and then add the text you wan't to appear as the placeholder in the field label you should find it works.

    Posted 6 years ago on Monday April 8, 2013 | Permalink
  6. Thank you so much Richard!!
    This process is very confusing. I (along with MANY other requests from other users) sure wish this was a feature of GF. Especially as the only form on the GF homepage uses this.

    Posted 6 years ago on Monday April 8, 2013 | Permalink
  7. Cool - thanks Richard :)

    Posted 6 years ago on Tuesday April 9, 2013 | Permalink
  8. Richard Vav
    Administrator

    You're welcome, I am sure the developers will find away of including placeholders in gravity forms at some stage, it's only recently become widely supported by the browsers

    Posted 6 years ago on Tuesday April 9, 2013 | Permalink

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