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.

Can Gravity Forms show a block of HTML above form div (i.e. for non-JS browsers)

  1. Hi guys!

    First, LOVE Gravity Forms - totally awesome tool!!

    The conditional logic is great, i.e. only show fields that matter for the topic of the contact - so a person contacting you to advertise will see different fields than someone contacting you with a support question.

    BUT found that enabling any conditional fields hides the entire form by default and uses JavaScript to show parts of it.

    Is there a way to include a bit of HTML "above" the form, so that it's visible without JavaScript, i.e. a "this form requires JavaScript, please enable it" notice in <noscript> tags.

    The problem is that many browsers have JavaScript disabled - either in preferences or us a plugin like the very popular NoScript browser plugin to disable most JavaScript.

    That's fine, it's OK to show a note that says "this form requires Javascript". But I would like to show that note ONLY IF their JavaScript is disabled, like so:

    <noscript>
    <div style="color: darkred;"><strong>This form requires JavaScript, but JavaScript seems to be disabled in your browser.
    <br>It is either turned off in your browser preferences, or it is disabled by a browser plugin like "NoScript".
    <br>Please enable JavaScript in your browser for this form to work properly. Thank you!</strong>
    </div>
    </noscript>

    However including this in the form description won't work, since the entire form is hidden.

    You could put the above code in the WordPress page itself (HTML mode), but the WYSIWYG editor mangles it every time when switching between HTML and Visual view.

    Here's the dev site page I'm testing this on - http://blogsuccessjournal.djmdev.com/contact/

    if there's not a way currently to show a block of HTML above the form, that could be a great additional field under form settings. :-)

    Thanks!
    Dan

    Posted 12 years ago on Saturday April 14, 2012 | Permalink
  2. kyle
    Member

    What i would do is use a shortcode that returns your no script code listed above, so then in the WordPress page you just need to put:

    [noscript]

    [gform...]

    Posted 12 years ago on Saturday April 14, 2012 | Permalink
  3. Hey Kyle! That's a great suggestion, but I'm looking for something that does not require editing the theme code, i.e. adding shortcodes requires manually editing site code, i.e. functions.php

    When we just had a small blog years ago, editing theme files was no big deal. These days every change requires full scale regression testing across all our sites, etc, etc. And hard coding text in functions is even works, because every time you want to change the wording of that shortcode, testing begins anew. :-)

    hoping for an easy way to do this within Gravity Forms.

    Thanks!
    Dan

    Posted 12 years ago on Saturday April 14, 2012 | Permalink
  4. kyle
    Member

    Are you okay with adding JavaScript? You could put that text into the page - just inside a div, and then hide the div with JavaScript. If js is disabled they see it. If enabled, they don't.

    Or add the first shortcode as a plugin..

    Posted 12 years ago on Saturday April 14, 2012 | Permalink