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.

keep form open when there are errors

  1. I am using trhe followinf jQuery to hide the form apart from the header of the form:

    jQuery('#primary .gform_wrapper').not('.page-contact-us #primary .gform_wrapper').hide();
    
    		jQuery("#primary .gform_widget h3").click(function(){
    		// slide toggle effect set to slow you can set it to fast too.
    		jQuery('#primary .gform_wrapper').slideToggle("slow");
    		return true;
    		});

    When a form errors ie a field is missed is there a way to capture that so i can make sure the form is not closed and hidden ?

    Posted 13 years ago on Tuesday July 26, 2011 | Permalink
  2. If you call the form using AJAX then it shouldn't reload the page or anything so it shouldn't close your slide toggle, it would remain visible. This scenario is one of the situations the AJAX option was made for.

    Posted 13 years ago on Tuesday July 26, 2011 | Permalink
  3. I would prefer to do that but when a form uses AJAX it pits the script tags onto the page and then it doesnt validate in HTML5 :(

    Posted 13 years ago on Tuesday July 26, 2011 | Permalink
  4. 1.6 will be adding CDATA around the script output, which should correct this when validating for XHTML but i'm not 100% if this will validate with HTML5, i'm guessing it will. You know not validating for something minor doesn't mean it's broken right?

    It's like using an HTML5 field on a non-HTML5 doctype page, it's still going to work just fine with browsers that support it and fall back just fine with browsers that don't.

    Posted 13 years ago on Tuesday July 26, 2011 | Permalink
  5. In most circumstances I would not mind if it doesnt validate as you say because it still functions and still falls back nicely but in this case it is a requirement from the client that it needs to validate. Believe me I have spoken to them at length on the subject but because they are promoting the fact the site is all singing and dancing they want to have everything working prefectly and all validating.

    Thanks for the update I am looking forward to the next release :)

    Posted 13 years ago on Wednesday July 27, 2011 | Permalink