On a lot of sites lately, I\'ve seen buttons being replaced with loading/thinking images after they are pressed, to prevent double clicks and make sure the user knows something
This replaces all submit inputs with an image onsubmit of the form
$(function() {
$("form").submit(function() {
$(":submit").replaceWith('
');
});
});
You may also want to disable submitting the form again, in case the user hits enter in a form field...
$(function() {
// only run this handler on the first submit of the form
$("form").one("submit", function() {
// replace all submit inputs with an image
$(":submit").replaceWith('
');
// don't let this form be submitted again
$(this).submit(function() { return false; });
});
});