$('form').submit(function(){ $('input:submit').attr("disabled", true); }); $(window).unload(function(){ $('input:submit').removeAttr("disabled"); });