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.

display: none on form

  1. lerizzle
    Member

    So I have a form In that for I have 1 field that is conditional. I assume because of it my entrie for has display: none on it. So without Javascript the form just doesn't show.

    Is there a way to stop that? If someone has Javascript disabled I'd rather they see the same drop down 3 times then not see anything at all.

    Is there maybe a way to always output a noscript tag before all the forms?

    Posted 12 years ago on Wednesday January 25, 2012 | Permalink
  2. tamlyn
    Member

    I had this problem too so I wrote a filter. It prepends each form with a bit of HTML and CSS which forces the form and all fields to be displayed if JavaScript is disabled.

    add_filter('gform_form_tag', 'outlandish_gform_accessibility');
    function outlandish_gform_accessibility($html) {
    	$noscript = '<noscript><style> .gform_wrapper, .gfield { display: block !important; } </style></noscript>';
    	return $noscript . $html;
    }
    Posted 12 years ago on Thursday February 23, 2012 | Permalink

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