Skip to content

Instantly share code, notes, and snippets.

@brigand
Forked from anonymous/gist:8705602
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brigand/8705615 to your computer and use it in GitHub Desktop.
Save brigand/8705615 to your computer and use it in GitHub Desktop.
function disable_submit_button(obj) {
var selector = 'input[type="submit"]';
var in_sub;
if (!obj) {
in_sub = document.querySelectorAll(selector);
} else {
var in_sub = obj.querySelectorAll(selector);
}
setTimeout(function(){
if (in_sub) {
for (var i=0; i< in_sub.length; i++) {
$(in_sub[i]).attr('disabled', true);
}
}
}, 1);
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment