Came across this twice in the past two weeks.
How NOT to do it:
$('form :submit').click(function() {
$(this).attr("disabled", true);
$(this).val("wait...");
$(this).addClass("disabled");
});
Doing it the above way, the click event will indeed fire, but on some browsers the submit event will not.
The event to bind to is submission of a form, not clicking of a submit button.
How to do it:
$('form').submit(function() {
$(":submit").attr("disabled", "disabled");
$(":submit").val("wait...");
$(":submit").addClass("disabled");
});
Also, the :submit selector is a jQuery cross-browser selector for input and button elements that could submit the form, used in preference to input[type="submit"]