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.

Clear default values on click and disable validation completely

  1. Hi,

    I'm trying to work out how to clear the default values on my input fields when they are clicked.

    I have a lead capture page and I'm using the Aweber addon. I have two fields... Name and Email and both have the values "Name" and "Email" in the respective fields.

    When a visitor clicks on the either field they need to manually delete the value first... how can I automate this please? (I thought this would be a standard feature.. have I missed something?)

    Also, is there a way to prevent prevent the validation errors messages and areas being displayed... I've used css to remove the actual text but I still have the red area around the fields. If I use css to remove this area then the entire field disappears.

    Thanks

    Brad

    Posted 12 years ago on Tuesday October 9, 2012 | Permalink
  2. Brad,

    You can follow this walkthrough to clear the values:
    http://www.gravityhelp.com/clearing-default-form-field-values-with-jquery/

    I can help you axe the styling on validation if you can provide a link to your form.

    Posted 12 years ago on Tuesday October 9, 2012 | Permalink
  3. Hey Rob - thanks for your response here.

    I did try that post you mentioned but I cant get it to work. I've added the script to the header and I've added the class to the fields.. just not working! I thought that as that post was created a few years ago that Gravity forms may have another solution, ah well!

    My link is here http://bit.ly/SJQuxX

    Thanks

    Brad

    Posted 12 years ago on Tuesday October 9, 2012 | Permalink
  4. Hey Brad, no problem. So it looks like you have a couple of JS errors going on here on your page. See this Screenshot.

    It seems that is occuring because your jQuery reference is in the footer and this JS block you added is in the head. I'd see about moving that jQuery reference up into the head instead of the footer.

    Try updating this CSS into your theme's stylesheet:

    [css]
    body .subscribe-form .gform_body .gform_fields .gfield_error {
    background: none;
    border: 0;
    padding: 0 !important;
    }
    Posted 12 years ago on Tuesday October 9, 2012 | Permalink
  5. ckracht
    Member

    I am already using gf_inline for my form fields. Is there any other way to do this? Maybe call the style some other way. I have a horizontal form and I don't think I can remove the gf_inline class and format the layout in another way.

    Thanks

    Posted 12 years ago on Wednesday October 31, 2012 | Permalink
  6. @ckracht please begin a new topic with a description of your problem and a link to the page where your form is embedded online, so we can take a look at it. We'll address your issue one-on-one in the new topic. Thank you.

    Posted 12 years ago on Wednesday October 31, 2012 | Permalink
  7. ckracht
    Member

    Chris no need. I looked at someone else code and saw that you can just put two CSS tags in the form editor with a space between them. Now it is working fine. Thanks!

    Posted 12 years ago on Wednesday October 31, 2012 | Permalink
  8. Very good. Glad you resolved that issue.

    Posted 12 years ago on Wednesday October 31, 2012 | Permalink
  9. I didn't want to hijack a post, but I am also having an issue with this. Here is a link to the page I am using this script on...

    http://www.luthwedding.com/event/rsvp

    Posted 11 years ago on Wednesday November 28, 2012 | Permalink
  10. Anthony, I see the clearit script in the source of the page. but I don't see that CSS class on any of the fields. See this screenshot: http://www.gravityhelp.com/wp-content/uploads/2009/11/clearfield_screen.jpg

    Without any css class of clearit, the script won't do anything.

    Also, there is a newer 3rd party add-on which will provide placeholders for you:
    http://wordpress.org/extend/plugins/gravity-forms-placeholders/

    Posted 11 years ago on Saturday December 1, 2012 | Permalink
  11. Yeah, I finally just gave up on it and just went on without it. Thanks tho!

    Posted 11 years ago on Saturday December 15, 2012 | Permalink
  12. Thank you for the update.

    Posted 11 years ago on Monday December 17, 2012 | Permalink

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