Support » Plugins » [Plugin: Contact Form 7] AJAX Not Working with WP2.8

  • Resolved digitz

    (@digitz)


    Just upgraded to WP2.8, AJAX is not working in CF7 and also, the terms acceptance checkbox which disables the submit button is not working either.

    Any help would be appreciated.

Viewing 15 replies - 1 through 15 (of 26 total)
  • Indeed. 🙁

    Really? It’s working on my site. I’m using WP 2.8 + CF7 1.10.0.1.

    I found a couple of bugs in wp-contact-form-7.php.

    1) in function wpcf7_plugin_url( $path = ” )

    global $wp_version;

    Needs to be added before the first if statement so that the variable is available within that function.

    2) in function wpcf7_enqueue_scripts()

    TRUE should be removed as a parameter passed to wp_enqueue_script as it’s not a valid parameter.

    FYI, the whole point is that w/ those bugs the necessary JS files do not get included on the page via wp_head() in the templates.

    1) in function wpcf7_plugin_url( $path = ” )

    global $wp_version;

    Needs to be added before the first if statement so that the variable is available within that function.

    oops. I forgot the global declaration. Thanks jinkim.

    2) in function wpcf7_enqueue_scripts()

    TRUE should be removed as a parameter passed to wp_enqueue_script as it’s not a valid parameter.

    The fifth parameter of wp_enqueue_script is supported from WP 2.8.

    http://core.trac.wordpress.org/browser/tags/2.8/wp-includes/functions.wp-scripts.php#L82

    When the value is set as true, the script will be included in the footer, instead of the header.

    Takayuki,

    Would you please issue a patch for this problem?

    You can see the changed point here.

    http://plugins.trac.wordpress.org/changeset/125989/contact-form-7/trunk/wp-contact-form-7.php

    If you need the whole package, download from here.

    http://wordpress.org/extend/plugins/contact-form-7/download/

    (‘Development Version’ at the bottom)

    Still, this fix didn’t help with the AJAX issue.

    Submit button isn’t disabled before confirming the “terms” checkbox, plus AJAX is not functioning, in other words, the whole page refreshes after the form is submitted.

    Maybe there are some JavaScript conflicts on your site. Can I see the site so I can point out the conflicts?

    m u s a v i s . c o m

    Takayuki, but it was working great on WP 2.7.1
    Upgrading to WP 2.8 messed things up.

    Oh, sorry! I forgot to mention this.

    Since WP2.8, the javascripts of Contact Form 7 are loaded in the footer of the pages, instead of header. So you need to call wp_footer() in the footer.php of your using template, like wp_header() in header.php.

    This article describes it in detail.

    Loading JavaScript In Footer In WordPress 2.8

    I inserted the following code at the top of my footer.php:

    <?php wp_footer(); ?>

    But still no use.

    Okay, the javascripts came to be shown on the footer. Now another problem is conflict with other javascripts. By looking at the HTML source, jQuery.js is loaded twice (line #15 and #218), and FireBug shows error in the slider.js (#219). They are blocking the javascripts of Contact Form 7 from working.

    I’m having the same problem re: Ajax. The forms submit and I get the emails, but the “your form was sent, etc” notice isn’t working; the form just refreshes.

    wp_footer(); is called in the footer. jQuery.js is called in the head and jQuery.form.js in the footer. I’ve tried removing them (first one, then the other), and it breaks the plugin, so I’m all out of ideas.

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘[Plugin: Contact Form 7] AJAX Not Working with WP2.8’ is closed to new replies.