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 field not working on paged form

  1. Nick Hempsey
    Member

    I'm using the handy jquery snippet for clearing fields, with a slight modification to clear all inputs instead of just ones with .clearit.

    This is working great on one of my standard 1 pages forms, but the other is paged and it's not working.

    http://2013.studio412design.com

    Click "Contact" to see the working form.

    Click "Request a Quote" (above the logo) to see the non-working form.

    I've tried a bunch of stuff, including being more specific in the call and specifying the ID of the input and nothing works. It's like there is a conflict with the pagination or something.

    $.fn.cleardefault = function() {
    			return this.focus(function() {
    				if( this.value == this.defaultValue ) {
    					this.value = "";
    				}
    				}).blur(function() {
    				if( !this.value.length ) {
    					this.value = this.defaultValue;
    				}
    			});
    		};
    		$("input, textarea, .input, #input_9_7").cleardefault();

    Any insight would be helpful.

    Thanks!

    -Nick

    Posted 11 years ago on Wednesday February 6, 2013 | Permalink
  2. Are you using a different script or function for the "Request a Quote" pull down vs. the Contact pull down?

    Does the clearit script in the "Request a Quote" form work properly when it's not in your toggle/pull down?

    To test your pagination theory, can you put a text field on the first page with default text and see if it will clear?

    It's possible on a multi-page form that you need to initialize the clearit script again. You can use the gform_post_render hook to do that: http://www.gravityhelp.com/documentation/page/Gform_post_render

    Posted 11 years ago on Wednesday February 6, 2013 | Permalink
  3. Nick Hempsey
    Member

    Hey Chris,

    The script for the pull down is just a class toggle for the element wrapper. Nothing fancy.

    I tried putting the form on a page by itself and it still failed. I removed a bunch of extra js that I had and it still failed.

    Also, binding to gform_post_render didn't seem to work either.

    Posted 11 years ago on Saturday February 9, 2013 | Permalink
  4. Can you post a link to the page where you embedded the form and it still failed? It will be easier for me to troubleshoot there.

    Posted 11 years ago on Saturday February 9, 2013 | Permalink