Created
July 8, 2011 19:46
-
-
Save skiz/1072655 to your computer and use it in GitHub Desktop.
Revisions
-
skiz created this gist
Jul 8, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ $.fn.preventDoubleSubmit = function() { $(this).submit(function(event) { if ($(this).hasClass('submitted')){ event.preventDefault(); return false; }else{ $(this).addClass('submitted'); return true; } }); }; $('form').preventDoubleSubmit();