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.

Using conditional logic hides entire form

  1. techguytom
    Member

    Plugin version is 1.3.13.1 - WordPress version 3.1

    I have a comment field that is set to "show" if a checkbox is checked. When I preview the form everything works as expected. When the form is viewed on the site this code is output:

    <div style="display: none;" id="gform_wrapper_2" class="gform_wrapper"><form action="" class="" id="gform_2" enctype="multipart/form-data" method="post">

    thus hiding the entire form. The only other plugin installted is All In One SEO but I've disabled it with the same results.

    Posted 13 years ago on Thursday August 5, 2010 | Permalink
  2. It's difficult to say since you didn't include a link to your form. One reason this happens is because of a raw, or noformat shortcode that's been added to the theme. If you look near the footer of the page, you'll see some inline script for the conditional logic. Check to see if the script is wrapped by a <p > tag. If so, that's probably the case.

    You can refer back to this thread for more information.

    http://forum.gravityhelp.com/topic/form-worked-for-a-while-and-then-disappeared#post-6394

    The other reason could be that you've embedded the form in a widget or via the function call and haven't enqueued the scripts necessary for the conditional logic functionality.

    When using a Gravity Form in a sidebar widget or embedding it anywhere using the function call, you need to manually enqueue the scripts and CSS by placing a short script block in your theme's functions.php file.

    wp_enqueue_script("gforms_ui_datepicker", WP_PLUGIN_URL . "/gravityforms/js/jquery-ui/ui.datepicker.js", array("jquery"), "1.3.9", true);
    
    wp_enqueue_script("gforms_datepicker", WP_PLUGIN_URL . "/gravityforms/js/datepicker.js", array("gforms_ui_datepicker"), "1.3.9", true);
    
    wp_enqueue_script("gforms_conditional_logic_lib", WP_PLUGIN_URL . "/gravityforms/js/conditional_logic.js", array("gforms_ui_datepicker"), "1.3.9", true);
    
    wp_enqueue_style("gforms_css", WP_PLUGIN_URL . "/gravityforms/css/forms.css");

    Without this, the conditional logic scripts, datepicker script, form CSS and other elements needed for the full form functionality aren't loaded.

    You can find more information at the URL below

    http://www.gravityhelp.com/documentation/embedding-a-form/

    Posted 13 years ago on Thursday August 5, 2010 | Permalink
  3. techguytom
    Member

    Here is a link to the page with the form http://173.203.97.192/maidserviceskansascity.com/public/custom-quote/
    This site is not live yet. I am calling the form with within the template, not as a shortcode. In fact no shortcodes are being used in the site at all. A form is on the home page and displays fine, but it's not using any conditional logic.

    Posted 13 years ago on Thursday August 5, 2010 | Permalink
  4. Hmm - I bet your theme uses shortcodes and you just don't know it. Have you done a file search for anythin related to "shortcode"?

    Posted 13 years ago on Thursday August 5, 2010 | Permalink
  5. @techguytom,

    You need to enqueue the scripts and form css by placing the snippet above in your functions.php file. Forms with conditional logic won't work without it.

    Once you've added that, you should be good to go.

    Posted 13 years ago on Thursday August 5, 2010 | Permalink
  6. techguytom
    Member

    Thanks Kevin, that was it.

    Posted 13 years ago on Thursday August 5, 2010 | Permalink
  7. Awesome. Glad it's working now. Thanks for the update.

    Posted 13 years ago on Thursday August 5, 2010 | Permalink

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