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.

Enabling conditional logic causes form to disappear

  1. karlbitz
    Member

    Hello -

    I'm having issues with conditional logic based on dropdown fields. I've looked at other threads and nothing seems to fix my issue. I'm using a theme I wrote myself - what's strange is that one form I have works fine with conditional logic, the only difference is that the logic is based on radio buttons rather than a dropdown.

    * wp_head and wp_footer are called correctly
    * mod_security is not installed on my server
    * file permissions are correct
    * no 404 errors, I can view every .js file called in the page source
    * no errors at all, page is just blank, but all the form fields are present in the source
    * AJAX works on all forms (date picker is proof)
    * form in question works in preview mode, and in the default wordpress theme

    I know that it is something wrong with my theme, but I'm out of ideas.

    Thoughts?

    Wordpress version: 3.2.1
    Gravity forms version: Latest
    PHP version: 5.3

    Posted 13 years ago on Thursday August 25, 2011 | Permalink
  2. It's a theme problem. Can you provide a link to the page containing the form so we can take a look? If we can see the page we can debug the issue.

    Posted 13 years ago on Thursday August 25, 2011 | Permalink
  3. karlbitz
    Member

    I can't - it's an internal site, so I'll keep investigating. Every form works fine except those with conditional logic based on a dropdown field. No ideas? Conditional logic based on a radio button field works fine.

    Posted 13 years ago on Thursday August 25, 2011 | Permalink
  4. karlbitz
    Member

    I've narrowed it down to this piece of code I added to header.php provide min_dates to some of my forms. The form id I'm having problems with is 12 for reference.

    <script type="text/javascript">
    	jQuery.noConflict();
    	jQuery(document).ready(function($) {
    		$( "#input_1_2" ).datepicker({ defaultDate: '+1d', minDate: '+1d', gotoCurrent: true });
    		$( "#input_1_3" ).datepicker({ defaultDate: '+2d', minDate: '+2d', gotoCurrent: true });
    		$( "#input_10_10" ).datepicker({ defaultDate: '+1d', minDate: '+1d', gotoCurrent: true});
    	});
    </script>
    Posted 13 years ago on Thursday August 25, 2011 | Permalink
  5. Hi Karl,

    Could you recreate this issue on a WP install that we could access?

    Posted 13 years ago on Friday August 26, 2011 | Permalink
  6. karlbitz
    Member

    Not really - I'll experiment with the above. When I remove that code, everything works as expected, when I have it present, conditional logic breaks. I'll echo back if I figure it out.

    Posted 13 years ago on Friday August 26, 2011 | Permalink
  7. karlbitz
    Member

    This was solved because the datepicker jQuery call to set the minDate option seemed to be causing errors if it wasn't actually used on the page. I used a conditional if(is_page(id)) PHP line to only output the minDate lines on the relevant pages. Probably something good to note when recommending people add the jQuery calls to set a min date blindly in their theme's header.

    Posted 13 years ago on Saturday August 27, 2011 | Permalink
  8. Thanks for the tip. Glad you were able to resolve your issue.

    Posted 13 years ago on Saturday August 27, 2011 | Permalink

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