Sometimes it is necessary to have a submit button become disabled and change the text value of the submit button when a form is submitted. This can be easily accomplished using jQuery (put in the <head> section): /**
* Disable submit button
*/
$(function(){
$('input:submit').click(function(){
$(this).val('Loading...');
$(this).attr('disabled', 'disabled');
$(this).parents('form').submit();
});
});
$(window).load(function(){
$('input:submit').removeAttr('disabled');
});