Created
August 25, 2010 05:40
-
-
Save mikhailov/548933 to your computer and use it in GitHub Desktop.
automatically show/hide ajax-spinner + disable/enable submit buttons
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
var spinner = $('#ajax-spinner'); | |
$(document).ajaxSend(function() { | |
$('input[type=submit]').attr('disabled', 'disabled'); | |
$('#warningBox').hide(); | |
spinner.show() | |
}).ajaxStop(function() { | |
$('input[type=submit]').removeAttr('disabled'); | |
spinner.hide() | |
}); | |
$("form").submit(function(){ | |
$('input[type=submit]').attr('disabled', 'disabled'); | |
return true; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment