Skip to content

Instantly share code, notes, and snippets.

@lucas-pelton
Last active July 3, 2019 14:28
Show Gist options
  • Save lucas-pelton/35cd6e09e80532b14a949d3046ce8c4e to your computer and use it in GitHub Desktop.
Save lucas-pelton/35cd6e09e80532b14a949d3046ce8c4e to your computer and use it in GitHub Desktop.
Prevent multiple clicks and submissions in Contact Form 7
//http://epsiloncool.ru/programmirovanie/preventing-multiple-submits-in-contact-form-7
jQuery(document).on('click', '.wpcf7-submit', function(e){
if( jQuery('.ajax-loader').hasClass('is-active') ) {
e.preventDefault();
return false;
}
});
@tiagomatosweb
Copy link

Legend!

@raman3366
Copy link

Fantastic. Works fine. I've included the code between <script> tags under submit short code of contact form 7. Is it the right place to include? Any other suggestions to make it work universally in all forms?

@karimraoudy
Copy link

As said LENGEND

@arshidkv12
Copy link

You can prevent duplicate submissions or you can check email already exists. Please check following url https://ciphercoin.com/downloads/cfdb7-unique-field/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment