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.

Entire Form Disappears When Conditional Logic Fields are Added

  1. Kevin Geary
    Member

    http://team.karate-usa.com/contact-us/join-our-team

    When I don't use conditional logic on any of the fields, I can see the form. If I enable conditional logic on a field, the entire form disappears. This is not a plugin conflict as I've already disabled them all to see if that was the problem.

    Posted 14 years ago on Wednesday December 2, 2009 | Permalink
  2. karateusa,
    The problem with your form is that not all the required script files are being rendered in the page. This usually happens because:
    1- Your theme does not call wp_footer()
    2- You are embedding a form to your page using the gravity_form template tag and place the tag after the loop.

    If you are not sure where to look and would like us to take a look at it, please send your user/password to alex[at]rocketgenius.com and I will take a look at it.

    Posted 14 years ago on Wednesday December 2, 2009 | Permalink
  3. We have looked into this and your footer theme file is not calling the wp_footer() function call so Gravity Forms is unable to include the necessary Javascript that Condtional Logic uses. I have placed this function call in your footer file and the form is now displaying.

    You will need to do some CSS adjustments as the form is inheriting some of your theme styles.

    I would suggest copying all the styles from gravityforms/css/forms.css and placing them in your Themes stylesheet and then in the Gravity Forms Settings page turn off CSS output. Then you can edit the styles in your Themes stylesheet.

    Don't edit the CSS directly in the plugins folder as these changes would get overwritten by plugin updates.

    Posted 14 years ago on Wednesday December 2, 2009 | Permalink
  4. FBS_web
    Member

    I am having the same problem with a form on my website: http://test.fbs.admin.utah.edu/index.php/forms/step3confirmreservation/
    Thanks,

    Carl Larson

    Posted 14 years ago on Thursday December 3, 2009 | Permalink
  5. If you are having the same problem, look at the resolution I posted above. It's a theme issue, not a Gravity Forms issue.

    Themes should include the wp_footer() function call in their footer.php file, otherwise plugins cannot write to the footer.

    Gravity Forms outputs the necessary logic for conditional logic to work using the footer. If that function call is not present, it does not get output.

    Posted 14 years ago on Thursday December 3, 2009 | Permalink
  6. FBS_web
    Member

    Thanks, that did the trick!

    Posted 14 years ago on Friday December 4, 2009 | Permalink
  7. I am having the same issue with one form on my site that was using conditional logic (I have since disabled CL on this form). The footer.php file contains
    <?php wp_footer(); ?>...is that what you are referring to?

    All other forms are working fine.

    Posted 14 years ago on Friday December 4, 2009 | Permalink
  8. Michel, can you post a link to a form so we can look at it and determine why it is not displaying? Thanks.

    Posted 14 years ago on Friday December 4, 2009 | Permalink
  9. Anonymous
    Unregistered

    Hello,
    I have the same issue, but none of your resolutions helps me.
    1, I have wp_footer() installed in footer.php
    2, I use the form tag inserted in the page text area
    3, I have tried to deactivate all plugins (except gravity forms of course :-)
    4, I have commented all other javascripts used by my theme
    5, I have tried diffrent theme

    Nothing works.
    Please help me.
    Thanks.

    My form is active on the test page:
    http://www.103.sk/gravity-test

    Posted 14 years ago on Friday December 18, 2009 | Permalink
  10. This is most likely directly related to the issue you are having with the form preview. One of your other plugins (or possibly theme but most likely a plugin) is causing Gravity Forms not to function properly.

    You are going to have to do a theme and plugin conflict test.

    Test for Theme Conflicts

    - Activate the default theme (Kubrick)
    - Test Gravity Forms to see if the preview works

    If it works, then there is something in your theme, most likely in the functions.php file preventing it from functioning properly.

    If it does not work then you will have to test for Plugin Conflicts.

    Test For Plugin Conflicts

    - Deactivate *ALL* Plugins
    - Activate Gravity Forms
    - Test to see if the form preview works
    - Activate each other plugin one by one, testing Gravity Forms form preview after each plugin you activate.
    - If you hit a plugin that causes it to stop working, make note of it and deactivate it and continue just to test all the plugins you are running.

    When you hit a plugin(s) that is causing a conflict, let us know and we can look into it for you.

    Unfortunately we have no control what other plugins do and some are very poorly written which can cause conflicts with other plugins despite the fact the plugin causing the conflict functions just fine.

    Posted 14 years ago on Friday December 18, 2009 | Permalink
  11. Anonymous
    Unregistered

    Wov, it is crazy but finally I found a problem with files premissions.
    In server error log I found this message:
    [Fri Dec 18 20:52:34 2009] [error] [client 78.98.112.39] SoftException in Application.cpp:256: File "/home/stotri/public_html/wp-content/plugins/gravityforms/js/conditional_logic.php" is writeable by group

    Then I have changed 777 permission on gravity forms files to 755, and NOW IT WORKS
    FINE! :-)

    Looks like my server firewall dislike 777 permissions :-)

    Thank you guys for this great plugin!

    Posted 14 years ago on Friday December 18, 2009 | Permalink
  12. Thanks! Glad you got it resolved.

    Posted 14 years ago on Friday December 18, 2009 | Permalink
  13. I seem to be having the same problem. I checked and do have the wp_footer() in the my footer. I also tried switching to one of the default themes to see if it was a theme issue. I'm pretty novice so don't understand the permission file thing.

    Any other ideas? I know you'll need info to be able to help me out but don't know what. the page i'm trying to put it on is http://afhmarketing.com/our-services/search-engine-marketing/request-a-search-engine-marketing-estimate/

    Posted 14 years ago on Saturday December 19, 2009 | Permalink
  14. @afhmarketing If you contact us via the contact us and provide us with a WordPress login for this site we can take a look at it to determine the issue.

    Posted 14 years ago on Saturday December 19, 2009 | Permalink
  15. Done, thanks Carl. I'm sure it's some stupid thing I'm not catching but look forward to hearing from you and knowing for next time.

    Posted 14 years ago on Saturday December 19, 2009 | Permalink
  16. have you guys had a chance to peek around from the email I sent?

    Posted 14 years ago on Tuesday December 22, 2009 | Permalink
  17. Yes, we are working on it and will be in touch very soon.

    Posted 14 years ago on Tuesday December 22, 2009 | Permalink
  18. I just emailed you a response... in a nutshell we think it is a file permission issue.

    Try changing the file permissions for the gravityforms plugin directory and all of it's files to 755. What is happening is your web server is returning a 404 for the necessary javascript when a page includes the conditional logic JS file, which is why it only occurs with forms that use conditional logic.

    A user above ran into the same issue and changed his permissions and that solved the problem. You can see his post here:

    http://forum.gravityhelp.com/topic/entire-form-disappears-when-conditional-logic-fields-are-added#post-2234

    I sent you an explanation via email also. Let me know if this corrects the issue. Thanks!

    Posted 14 years ago on Tuesday December 22, 2009 | Permalink
  19. I'm resisting the urge to start another thread because I'm having the same issue for a different reason.

    • I'm on XP/XAMPP testing with WPMU, default theme, 2.9RC1, all plugins disabled.
    • Disable conditionals shows the form, but page source shows no .js except comment-reply
    • Enable conditionals, I can see the html/css in page source, but no form is displayed. A call to jquery 1.3.2 is visible in page source
    • Since I'm having path issues (see post on preview), I'm assuming I'm getting a 404 for the js file.
    • File structure = root has two files and two directories - wp-config and htaccess, and /core and /wp-content. /core has everything except /wp-content in it.

    Please help. BTW, I can see this alternate file structure is wreaking havoc on plugins as you hardcode both path and directory names, each of which is flexible according to the Codex.

    Posted 14 years ago on Tuesday December 29, 2009 | Permalink
  20. Can you provide a URL to a page with a form on it so that we can take a look?

    You didn't mention if the calls to the conditional_logic.js and conditional_logic.php (which outputs javascript) were present in the footer of your form when you view source. If they are not, it is because the wp_footer() call is not present in your theme's footer file.

    The paths used in the plugin are not hardcoded. We use the built in WordPress function to return the dynamic path to the plugin and then build from that.

    Posted 14 years ago on Tuesday December 29, 2009 | Permalink
  21. I'm on my home PC, so I doubt I could provide a working url.

    With conditional logic on, I get the following in the footer:

    <script type='text/javascript' src='http://localhost.localdomain/wpmu/wp-content/plugins/gravityforms/js/conditional_logic.js?ver=2.9-rc-1'></script>
    <script type='text/javascript' src='http://localhost.localdomain/wpmu/wp-content/plugins/gravityforms/js/conditional_logic.php?form_id=1&ver=2.9-rc-1'></script>

    Those calls look right from my directory structure.

    The div for the form and all its elements are in the page source too, including the iframe for the recaptcha. Just nothing shows up.

    Because I'm on a windows PC, I can't change file permissions.

    Posted 14 years ago on Thursday December 31, 2009 | Permalink
  22. On a whim, I opened up conditional_logic.php and found the problem. It uses the same construct as in preview.php:
    require_once (preg_replace("/wp-content.*/","wp-blog-header.php",__FILE__));

    which at least on my system doesn't work. I applied the same fix as I did for my previous problem http://forum.gravityhelp.com/topic/path-errors-on-previewphp.

    It works and looks like:

    $local_path = $_SERVER['DOCUMENT_ROOT'].'/wpmu/core/';
    
    require_once ($local_path . "wp-blog-header.php");

    Now, I have to figure out how to keep track of this stuff or upgrading is going to kill me.

    Posted 14 years ago on Thursday December 31, 2009 | Permalink
  23. We will check this out when we check out the other one you pointed out and see what we can do to apply an update that will fix this in the future.

    Posted 14 years ago on Thursday December 31, 2009 | Permalink
  24. webakimbo
    Member

    Posting my own findings in case it helps anyone. I'm on WP 3.0.1; was experiencing the bug that started this thread; had the wp_footer() call properly placed; and got no change even after reverting to the default theme and disabling all plugins except GF.

    My form is included in a custom view, however, and I was printing the GF form using do_shortcode(). The shortcode itself ('[gravityform id=1 name=CampaignLetter title=false description=false]') was not in the main content of the post.

    That was the problem. Adding it back into the main post content area fixed the issue.

    Posted 14 years ago on Tuesday October 12, 2010 | Permalink
  25. @webakimbo This is because depending on where you use the shortcode, it is unable to enqueue scripts because of how WordPress works. By executing the shortcode that way it was too late for the enqueue to happen because of the order in which WordPress hooks are executed. So you would have to manually enqueue the necessary scripts.

    Manually enqueuing scripts is discussed in the documentation on this page:

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

    Posted 14 years ago on Tuesday October 12, 2010 | Permalink
  26. I have the same issue but none of these helped.

    1). wp_footer() exists.
    2). Deactivated all plugins.
    3). Switched to kubrick
    4). Manually enqueued script and tried using template tag instead of short code.

    http://www.thefreemanonline.org/subscribe/gift-subscription/

    Form doesn't not work in preview either ... which would seem to indicate a bigger issue.

    Posted 14 years ago on Saturday November 6, 2010 | Permalink
  27. Actually, please disregard. I realized I hadn't upgraded to 1.4. Everything worked fine after upgrade.
    Cheers,
    Mike

    Posted 14 years ago on Saturday November 6, 2010 | Permalink
  28. Are there any negative consequences from enqueing the necessary libraries to alleviate the conditional logic problem described in this thread?

    Posted 14 years ago on Wednesday November 24, 2010 | Permalink
  29. @webstergroup No, you should be able to enqueue the necessary JS. However there should be no reason to if your theme is setup properly and you have wp_head() and wp_footer() function calls present in your header.php and footer.php files.

    The only time it should be necessary to manually enqueue the scripts is if you are displaying a form via the function call rather than the shortcode.

    Posted 14 years ago on Wednesday November 24, 2010 | Permalink
  30. @carl I have wp_head() and wp_footer() and displaying the form via shortcode. I am using the BETA release, if that makes a difference.

    I do know that when I enqueue the JS libraries it works.

    I will test for Plugin conflicts after I get this fire put out :)

    Posted 14 years ago on Wednesday November 24, 2010 | Permalink
  31. Impero
    Blocked

    "- Activate the default theme
    - Test Gravity Forms to see if the preview works

    If it works, then there is something in your theme, most likely in the functions.php file preventing it from functioning properly."

    After switching themes, my form was working fine.
    What in the functions.php file for my intended theme would be preventing the form from working properly?

    Posted 13 years ago on Monday December 27, 2010 | Permalink
  32. It's hard to say what it might be without looking at your theme more closely. It may not be in the functions.php file at all. It's most likely a another script being output on the page that's breaking. When this script errors out, the Gravity Forms conditional logic script won't run either.

    Posted 13 years ago on Tuesday December 28, 2010 | Permalink
  33. Impero
    Blocked

    Here is the page:
    mauiboattrips*com/book-now/

    I've disabled all plugins and checked, but that wasn't it.

    Any thoughts?

    Posted 13 years ago on Tuesday December 28, 2010 | Permalink
  34. I copied your page to test, disabled a few scripts and stuff like that I didn't find out what the culprit is so far. You may want to discuss it with your theme developer since it's definitely a theme-related issue.

    If you would like to send me a copy of your theme, I'll be happy to install it and dig a little more. You can send it to kevin@rocketgenius.com. Please reference this thread URL too in your email.

    Posted 13 years ago on Tuesday December 28, 2010 | Permalink
  35. I'm also getting an error only when using conditional logic - if I remove the logic, it works - If I use it, I get the following:

    "Forbidden - You don't have permission to access / on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

    I've set permissions on all files to 755 and still get this error. Does anyone have any ideas or solutions? I do have the "wp_footer()" in the footer as well.

    Test form page here: http://bit.ly/lw3mZ5

    Thanks!

    Posted 13 years ago on Thursday April 28, 2011 | Permalink
  36. @Chizno This is going to be a web server configuration issue. You may need to contact your web host about this. It's probably related to the AJAX call, so be sure to tell them that. Another solution would be to turn AJAX off for this form and see if it works properly, that will narrow it down to AJAX if it does. AJAX isn't always necessary, and on a single page form on a standard page like this... it's definitely not necessary so you could turn it off.

    Posted 13 years ago on Thursday April 28, 2011 | Permalink
  37. Pimp. Thanks Carl. I'll post a solution if I find one.

    Posted 13 years ago on Thursday April 28, 2011 | Permalink
  38. Still no dice. Disabling AJAX didn't help. I've got to think that my server's settings are pretty standard. Where is GF trying to go for the "/" while trying to send the email that the server would deny? Also, what would be different in GF while using a conditional statement versus not as it works fine without them.

    Thanks again.

    Posted 13 years ago on Thursday April 28, 2011 | Permalink
  39. It could be a mod_security firewall issue blocking the AJAX request. What happens is if the server uses mod_security, a mod_security setting could block the AJAX request because it thinks it's a malicious attack.

    If you are running on a Windows server it could be a URL rewriting issue.

    Talk to your web host and explain the issue. It's a site specific issue, other users aren't reporting this problem so it's something specific to your site setup.

    Posted 13 years ago on Thursday April 28, 2011 | Permalink
  40. Thanks Carl. Again, I'll post the update when I find out.

    Posted 13 years ago on Friday April 29, 2011 | Permalink
  41. SOLVED. It was the ModSec Control. If you have WHM access - go to "ConfigServer ModSec Control" and disable the rules on a per cPanel account or per domain basis by selecting a domain/user and then clicking "Modify user whitelist".

    Posted 13 years ago on Friday April 29, 2011 | Permalink
  42. rakshakfoundation
    Member

    I have the same issue. I have checked

    1) wp_footer() exists.
    2) Deactivated all plugins.
    3) conditional logic script is included
    4) Permissions are set correctly

    URL: http://www.rakshakfoundation.org/temp-2/

    Thanks

    Posted 13 years ago on Wednesday May 4, 2011 | Permalink
  43. Hi Rakshakfoundation,

    Did you try Chizno's solution:

    SOLVED. It was the ModSec Control. If you have WHM access - go to "ConfigServer ModSec Control" and disable the rules on a per cPanel account or per domain basis by selecting a domain/user and then clicking "Modify user whitelist".

    Posted 13 years ago on Wednesday May 4, 2011 | Permalink
  44. rakshakfoundation
    Member

    I do not see an error like Chizno did. In my case, the form with conditional logic is not visible. Should I still try what you suggested?

    Posted 13 years ago on Wednesday May 4, 2011 | Permalink
  45. Hi Rackshak,

    Could you provide a link to the form in question? Also, is it not displaying in all browsers or just IE?

    Posted 13 years ago on Wednesday May 4, 2011 | Permalink
  46. rakshakfoundation
    Member

    URL: http://www.rakshakfoundation.org/temp-2/

    The form is not visible in any of the browsers.

    Posted 13 years ago on Wednesday May 4, 2011 | Permalink
  47. Hi Rakshak,

    I noticed that you're loading jQuery as well as all the required Gravity Form scripts in your footer as opposed to inside the <head></head>. I downloaded a local copy of your page and after moving the scripts to the header, the form loaded smoothly.

    Posted 13 years ago on Wednesday May 4, 2011 | Permalink
  48. rakshakfoundation
    Member

    Thanks David. I moved the scripts to the head and the issue is fixed.

    Posted 13 years ago on Thursday May 5, 2011 | Permalink

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