Skip to content

Instantly share code, notes, and snippets.

@pietia
Created June 4, 2012 11:05
Show Gist options
  • Save pietia/2867751 to your computer and use it in GitHub Desktop.
Save pietia/2867751 to your computer and use it in GitHub Desktop.
jQuery.fn.preventDoubleSubmit = function () {
var alreadySubmitted = false;
return jQuery(this).submit(function () {
if (alreadySubmitted)
return false;
else
alreadySubmitted = true;
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment