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.

Buttons & conditional logic not functioning with Modal box

  1. danielpettifer
    Member

    I followed your tutorial to use the modal box to display a form. I used a simple form first which would not submit. I then tried to use conditional logic and this also will not work for me. I added the enqueue functions to my functions.php and I have called the form using php in the plain page template. I think I may have entered the enqueue function wrongly :(

    <?php
     /*
     Template Name: plain page
     */
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
      <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
      <meta name="MSSmartTagsPreventParsing" content="true" />
      <meta http-equiv="Imagetoolbar" content="No" />
      <title>My Form Title</title>
      <style type="text/css">
      	body {font-size:13px;}
      </style>
      <link rel='stylesheet' id='gforms_css-css'  href='<?php bloginfo('url'); ?>/wp-content/plugins/gravityforms/css/forms.css?ver=3.0.1' type='text/css' media='all' />
      <script type='text/javascript' src='<?php bloginfo('stylesheet_directory'); ?>/includes/js/jquery-142.js?ver=1.4.1'></script>
      <script type='text/javascript' src='<?php bloginfo('url'); ?>/wp-content/plugins/gravityforms/js/conditional_logic.js?ver=1.3.13.1'></script>
      </head>
    <body>
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
      <?php the_content('read more'); ?>
      <?php endwhile; endif; ?>
      gravity_form_enqueue_scripts(4,true);
      <?php gravity_form(4, false, false); ?>
      <?php wp_footer(); ?>
    </body>
    </html>

    Please let me know what you think I should do. Here is a link to the site, please ignore the absolute mess it is undergoing a lot of changes http://www.docsense.net/ click the let's get started button to open the modal window. Thanks!

    Posted 13 years ago on Tuesday March 22, 2011 | Permalink
  2. danielpettifer
    Member

    I have enclosed line 36 within php tags and still it is not working. I have disabled all other plug-ins, including the slideshow on the front page but still no luck. I read everything I could find on your site but still can not see a solution.

    Posted 13 years ago on Tuesday March 22, 2011 | Permalink
  3. danielpettifer
    Member

    In the plain page template you display on the tutorial there is no php call for wp_head. I have added this and everything seems to be working.

    Posted 13 years ago on Tuesday March 22, 2011 | Permalink
  4. The wp_head() call was intentionally omitted from that example so other unnecessary markup from other plugins, etc. wouldn't be inserted into the simple page template. I chose to simply hard-code paths to the forms CSS, etc. You could do the same with the paths to the conditional logic js, etc.

    If you're not concerned with other markup being added, then using the wp_head() function is fine too.

    Posted 13 years ago on Tuesday March 22, 2011 | Permalink
  5. danielpettifer
    Member

    Ok, I have stumbled upon a new issue.

    I have the modal window set up and when it appears there is a page giving you two options, one option links to form A and one to form B.

    The page links ok and the forms are showing but they do not show at all if there is any conditional logic in the forms. Each form has it's own php template (identical to the plain page template but calling the individual forms through php). The scripts are enqueued for the each of the individual forms (depending on template). Is there something I am missing?

    Posted 13 years ago on Thursday March 24, 2011 | Permalink
  6. It sounds like not all the scripts are being enqueued (specifically the conditional_logic script) OR there could be a Javascript error. Make sure the conditional_logic.js file is being enqueued and inspect the page using something like Firebug for FireFox to see if there is a Javascript error of some sort. A Javascript error will prevent the jQuery from executing.

    Posted 13 years ago on Thursday March 24, 2011 | Permalink
  7. danielpettifer
    Member

    Could you possibly tell me how to specifically enqueue the conditional logic. Do I need to insert code into the page template for each form? What is the code? Thanks again....

    Posted 13 years ago on Thursday March 24, 2011 | Permalink
  8. You can find directions on how to enqueue scripts in the documentation here:

    http://www.gravityhelp.com/documentation/page/Embedding_A_Form

    I suggest making sure you are using Gravity Forms v1.5 and then simply using the new enqueue function to enqueue the necessary scripts. It's documented on that page.

    Posted 13 years ago on Thursday March 24, 2011 | Permalink
  9. danielpettifer
    Member

    I updated from 1.5RC... to the new release, entered the code you specified and...so far so good, thanks again Carl! : )

    Posted 13 years ago on Friday March 25, 2011 | Permalink

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