Skip to content

Instantly share code, notes, and snippets.

@toddlahman toddlahman/gist:6302114
Last active Apr 3, 2019

What would you like to do?
Prevent Duplicate Form Submissions with jQuery
jQuery(function() {
$("form").submit(function() {
// submit more than once return false
$(this).submit(function() {
return false;
// submit once return true
return true;
/* or */
$(this).find(':submit').attr( 'disabled','disabled' );

This comment has been minimized.

Copy link

commented Apr 3, 2019

Thanks! That's really helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.