Wordpress - Contact form 7 does not work with the jquery DOM

0

I have this code that brings DOM documents to the page

$(document).ready(function(){
    $('.abas').on('click', function(){
        var paginas = ["pagina1.html","pagina2.html","pagina3.html"];
        aba_index = $(this).attr('tabindex');
        $('.abas').removeClass('active');
        $(this).addClass('active');
        $(this).load("caminho/"+paginas[parseInt(aba_index) - 1]);
    });
});

Within these pages, there is a form that the html is this

<form action="/#wpcf7-f6-p1065-o1" method="post" class="wpcf7-form" novalidate>
<div style="display: none;">
<input type="hidden" name="_wpcf7" value="6">
<input type="hidden" name="_wpcf7_version" value="4.9.2">
<input type="hidden" name="_wpcf7_locale" value="en_US">
<input type="hidden" name="_wpcf7_unit_tag" value="wpcf7-f6-p1065-o1">
<input type="hidden" name="_wpcf7_container_post" value="1065">
</div>
<div class="digite_email">
<span class="wpcf7-form-control-wrap email"><input type="text" name="email" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" aria-required="true" aria-invalid="false" placeholder="Digite seu e-mail"></span>
</div>
<div class="assinar">
<input type="submit" value="saber mais" class="wpcf7-form-control wpcf7-submit">
</div>
<div class="wpcf7-response-output wpcf7-display-none"></div></form>

For example:

When I open page1.html via DOM, the form does not work, I believe it's because the Contact Form 7 plugin uses jquery to submit the forms.

How can I make wordpress contact-form-7 work via DOM?

    
asked by anonymous 30.12.2017 / 11:08

1 answer

0

The ideal thing is to involve your script like this:

jQuery(document).ready(function($) { $(document).ready(function(){ $('.abas').on('click', function(){ var paginas = ["pagina1.html","pagina2.html","pagina3.html"]; aba_index = $(this).attr('tabindex'); $('.abas').removeClass('active'); $(this).addClass('active'); $(this).load("caminho/"+paginas[parseInt(aba_index) - 1]); }); }); });

I think doing this will solve your problem.

    
02.01.2018 / 02:47