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.

Conditional logic, form is not showing

  1. Hi,

    I've installed Gravity forms but the form is not showing when i used conditonal logics.
    http://94.103.150.222/~devtakecar/contact-opnemen/

    wp_footer is called in footer.php so that shouldnt be the problem.

    hope anyone can help me.

    Thanks!

    Posted 10 years ago on Monday June 10, 2013 | Permalink
  2. Richard Vav
    Administrator

    Your form is failing to appear because the Gravity Forms scripts aren't running due to multiple copies of jQuery being included, in the page header you have the following loading jQuery version 1.7.2 from your theme folder

    <script type='text/javascript' src='http://94.103.150.222/~devtakecar/wp-content/themes/cornmedia/js/jquery.min.js?ver=3.5.1'></script>

    and then down in the page footer you have the following loading jQuery version 1.7.2 again from your theme folder

    <script src="http://94.103.150.222/~devtakecar/wp-content/themes/cornmedia/js/jquery.min.js"></script>

    Loading multiple copies of jQuery is known to cause problems so you should remove the second call that is including it the footer. The best way to include jQuery in a theme is to enqueue the WordPress bundled version which for WordPress 3.5.1 is jQuery 1.8.3 like so

    wp_enqueue_script("jquery");

    This method ensures that no matter how many plugins require jQuery it is only ever included once even if it is already included by the theme.

    Regards,
    Richard

    Posted 10 years ago on Monday June 10, 2013 | Permalink
  3. Thanks! the jquery in the footer was indeed the problem!

    Posted 10 years ago on Monday June 10, 2013 | Permalink
  4. Richard Vav
    Administrator

    Thanks for the update, glad you got it sorted.

    Posted 10 years ago on Tuesday June 11, 2013 | Permalink
  5. choong.michael88
    Member

    Hi Richard,

    I'm running into a similar problem. The moment I tried to activate the conditional logic on one field, my whole form disappear. https://www.gardenschool.edu.my/test123/

    Could you please help? Many thanks.

    Michael

    Posted 10 years ago on Friday June 21, 2013 | Permalink
  6. David Peralty

    This is due to the same problems you are experiencing with your date picker. Please see my response there.

    Posted 10 years ago on Friday June 21, 2013 | Permalink
  7. Having conditional logic/form display problem also:
    http://bohsfootball.com/aaa-conditional-form-test

    Where do you edit to apply the suggested code?:

    wp_enqueue_script("jquery");

    Posted 10 years ago on Thursday June 27, 2013 | Permalink
  8. Richard Vav
    Administrator

    Hi Mark,

    The link to the google CDN copy of jQuery could be included by either a badly coded plugin or a function in your theme's functions.php file, I would start by checking your theme first so if you want to copy the contents of that file to Pastie or PasteBin I can take a look.

    Regards,
    Richard

    Posted 10 years ago on Thursday June 27, 2013 | Permalink
  9. OK I posted functions.php contents into PasteBin : Mark paste

    **** OK Don't think I did that correctly as I cannot find it. How do I place it in PasteBin so you can see it?

    *** I just pasted into next post below:

    Posted 10 years ago on Thursday June 27, 2013 | Permalink
  10. <?php
    // Start the engine
    require_once(TEMPLATEPATH.'/lib/init.php');
    require_once(STYLESHEETPATH.'/lib/init.php');

    // Add new image sizes
    genesis_add_image_size('Slider', 920, 300, TRUE);
    genesis_add_image_size('Featured Properties', 290, 200, TRUE);
    genesis_add_image_size('Featured Posts', 115, 115, TRUE);
    genesis_add_image_size('Small Thumbnail', 110, 80, TRUE);

    // Load script for jFlow slider
    add_action('get_header', 'agentpress_load_scripts');
    function agentpress_load_scripts() {
    wp_enqueue_script('jflow', CHILD_URL.'/lib/js/jquery.flow.1.1.js', array('jquery'), '1.1', TRUE);
    }

    /** Add the slider on the homepage above the content area */add_action('genesis_after_header', 'agentpress_include_slider'); function agentpress_include_slider() { if(is_front_page()) dynamic_sidebar( 'slider' );}

    // Force layout on homepage
    add_filter('genesis_options', 'agentpress_home_layout', 10, 2);
    function agentpress_home_layout($options, $setting) {
    if($setting == GENESIS_SETTINGS_FIELD) {
    if(is_home())
    $options['site_layout'] = 'content-sidebar';
    }
    return $options;
    }

    // Add a read more link to the excerpt
    add_filter('excerpt_more', 'agentpress_excerpt_more');
    function agentpress_excerpt_more($more) {
    return '... Read More';
    }

    // Remove post-info, post-meta, and author box from property posts
    add_action( 'get_header', 'agentpress_remove_property_extras' );
    function agentpress_remove_property_extras() {
    if( is_single() && genesis_get_custom_field('_features_1_col1_1') ) {
    remove_action('genesis_before_post_content', 'genesis_post_info');
    remove_action('genesis_after_post_content', 'genesis_post_meta');
    remove_action('genesis_after_post', 'genesis_do_author_box');
    add_filter( 'genesis_options', 'agentpress_remove_property_comments', 10, 2 );
    }
    }
    // Remove comments from property posts
    function agentpress_remove_property_comments($options, $setting) {
    if($setting == GENESIS_SETTINGS_FIELD) {
    $options['comments_posts'] = 0;
    }
    return $options;
    }

    // Register Sidebars
    genesis_register_sidebar(array(
    'name'=>'Featured Properties',
    'description' => 'This is the featured properties section of the homepage.',
    'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
    ));
    genesis_register_sidebar(array(
    'name'=>'Featured Posts',
    'description' => 'This is the featured posts section of the homepage.',
    'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
    ));
    genesis_register_sidebar(array(
    'name'=>'Multi-Agent Page',
    'description' => 'This is the main content area of the mult-agent page template.',
    'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
    ));genesis_register_sidebar(array( 'name'=>'Slider', 'id' => 'slider', 'description' => 'This is the slider section on the homepage',));
    // Fix Slider intermittent speed up issue after WP 3.2 upgrade
    function my_init_method() {

    if( is_admin() )
    return;

    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js');
    wp_enqueue_script( 'jquery' );
    }

    add_action('init', 'my_init_method');
    ?>

    Posted 10 years ago on Thursday June 27, 2013 | Permalink
  11. Richard Vav
    Administrator

    Mark,

    At the end of that file you have the following function

    function my_init_method() {
    
    if( is_admin() )
    return;
    
    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js');
    wp_enqueue_script( 'jquery' );
    }
    
    add_action('init', 'my_init_method');

    can you change it to the following

    function my_init_method() {
    wp_enqueue_script('jquery');
    }
    add_action('wp_enqueue_scripts', 'my_init_method');
    Posted 10 years ago on Friday June 28, 2013 | Permalink
  12. Thanks for your reply. I changed the file as above, however the form still doesn't ;load. Any other places to check?

    Posted 10 years ago on Friday June 28, 2013 | Permalink
  13. Richard Vav
    Administrator

    There are a couple of JavaScript errors that may be blocking the Gravity Forms scripts from running

    Failed to load resource: the server responded with a status of 404 (Not Found) http://bohsfootball.com/wp-content/themes/agentpress/lib/js/jquery.flow.1.1.js?ver=1.1
    Uncaught TypeError: Object [object Object] has no method 'jFlow' aaa-conditional-form-test:243

    it looks like the jquery.flow.1.1.js file is missing which is causing the Uncaught TypeError, if you can restore that file you may find the form will appear.

    Posted 10 years ago on Friday June 28, 2013 | Permalink

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