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.

initial value in field that goes away when user clicks into the field?

  1. Can Gravity for, do this?

    Also, if it can, does it affect required validation. I wouldn't want the initial text to qualify as meeting a required field

    Posted 13 years ago on Tuesday December 20, 2011 | Permalink
  2. What you are describing is referred to as placeholder functionality. It's text that appears inside an input and then when the user clicks on the field, it goes away. Currently this is not a built in feature of Gravity Forms, but it can be done as a simple customization.

    Here is information on how this can be done:

    http://www.gravityhelp.com/clearing-default-form-field-values-with-jquery/

    We do plan on implementing placeholder functionality as a native feature in the future. We were trying to hold out until HTML5 gained more acceptance so it could be implemented without requiring Javascript as HTML5 supports the placeholder attribute as a built in feature, but HTML5 adoption has been slow.

    So we are planning on implementing it as both HTML5 and a fallback to using Javascript sometime in the near year.

    Posted 13 years ago on Tuesday December 20, 2011 | Permalink
  3. minicast
    Member

    Here is an alterate method that uses the labels as placeholders and works with ajax validation:
    http://www.gravityhelp.com/forums/topic/heres-how-to-add-placeholder-functionality-which-works-with-ajax-validation

    Posted 12 years ago on Tuesday August 7, 2012 | Permalink
  4. Thanks for the code, @minicast.

    Posted 12 years ago on Tuesday August 7, 2012 | Permalink

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