can you link the page where this is happening?
one form doesen’t have a CF7 submit button, but I submit the form with Javascript/jquery .submit().
what triggers your submit script?
Thread Starter
jinzo
(@jinzo)
Another button (let’s call it “next”), that calls a JavaScript function that basicly does $(‘#my-form’).submit(); and some other trivial calls. I triple checked and this function get’s called only once 100%. Also if I disable this plugin, everything works as expected. No other changes needed.
Unfortunately I cannot link the page currently, will try to set it up somewhere
reposting—can you link the page where this is happening?
Unfortunately I cannot link the page currently, will try to set it up somewhere
missed that… If you can that would be helpful. Otherwise, can you send me a copy of your form to vrata at syllogic dot in and I will test this on my local server see if I can throw some light on this
I did a quick test on my local server with a anchor link as a submit button and fired the form submit as follows,
$(document).ready(function(){
$('#submit').on('click', function(){
var form = $(this).closest('form');
form.submit();
});
})
and it submits only once. So its all working as expected.
Is it possible that another plugin/script is interfering with your form?
Also if I disable this plugin, everything works as expected. No other changes needed.
the plugin creates an additional layer of wrapper around the cf7 form,
<div class="cf7sg-container">
<div id="cf7sg-form-ui-form" class="cf7-smart-grid has-nice-select has-validation has-select2 has-accordion has-effects has-grid has-date key_ui-form">
[...]
</div>
</div>
and maybe something else if interfering with the additional markup.
What are the other plugins you are using that load scripts on your form page?
Thread Starter
jinzo
(@jinzo)
Hi,
thanks for the tips – I found the fault. For some reason I was initialising the CF7 form in JS (with wpcf7.initform). I don’t remember why exactly, but after I stopped doing that, everything started working as expected.
Thanks for your help and pointers!
oh good. Glad you sort it out.