You can submit via jquery and disable the button:
<input type="submit" value="do it!" onclick="$('#mainform').submit(); $(this).attr('disabled','disabled' ); $('#pleasewait').show();" />
EDIT: I forgot form.submit () is not asynchronous. Instead, you can execute an ajax request:
$.ajax({
url: "someurl",
type:"POST",
cache: false,
dataType: "json",
success:gotIt,
async:true,
timeout:240000,
error:ajaxError,
data:$("#mainform").serialize()
});
or you can simply .hide () the button, or after clicking on it, set the inactive onClick () handler and stylize it to look disabled.
heeen source
share