Support » Plugin: Contact Form 7 » CF7 not loading JavaScript, take you a different page on submission

  • I’m doing something a bit different with CF7. I’m loading it into a div using JQuery on this one page site. Idea is the content is loaded in a div called #page-con on demand while the #panel div slides down and up.

    So if you click on CONTACT, the panel slides down with the form in it. If you submit the form, I get the results, but the user is taken to a different page on the site with the acknowledgment and also another form. But that’s not what I want. I want to stay on the homepage the entire time. Like you usually get when on standard CF7 sites. How can I accomplish on a site like this that isn’t typical WordPress?

    Here’s the code I’m using:

    <script type="text/javascript">
        jQuery(function($) {
        $("li.btn-slide a").on('click', function(e){
            var post_url = $(this).attr("href");
            var post_id  = $(this).attr("rel");
                          .load(post_url, function() { // content loaded callback
                var pageconHeight = $("#page-con").height();  // Find the height of the content inside #panel
                 $("#panel").animate({height: pageconHeight}, "slow"); // Animate the height of #panel

  • The topic ‘CF7 not loading JavaScript, take you a different page on submission’ is closed to new replies.