Forked from dharma017/jquery-prevent-muliple-form-submit.js
Created
September 30, 2016 06:27
-
-
Save anupkumarmaharjan/680fd661733186ed99bd52d5f3bdbb8f to your computer and use it in GitHub Desktop.
jQuery Prevent Multiple Form Submit
This file contains 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 characters
$(document).ready(function() { | |
$('form').submit(function() { | |
if(typeof jQuery.data(this, "disabledOnSubmit") == 'undefined') { | |
jQuery.data(this, "disabledOnSubmit", { submited: true }); | |
$('input[type=submit], input[type=button]', this).each(function() { | |
$(this).attr("disabled", "disabled"); | |
}); | |
return true; | |
} | |
else{ | |
return false; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment