jQuery Disable On Submit Plugin

Posed under jQuery on March 15, 2009.

Article

Comments

Post

paul irish

Mar 16 2009

Similarly this oneline could do the trick:

$('form').submit(function(){ $(':button',this).attr('disabled','disabled');});

Evan Byrne

Mar 17 2009

@paul: Your code doesn't remove the disabled attribute so if you refresh the page the button will still be disabled. Plus your snippet can only disable buttons.

jcargoo

Mar 18 2009

Here is another example:
http://www.jcargoo.org/2009/01/submit-button-enabling-with-jquery.html

atlantis151

Apr 06 2009

$('form').submit(function(){
$(':submit, :button',this).click(function(){
return false;
})
});

AG

Feb 23 2010

Is it working with type image ?

Evan Byrne

Feb 23 2010

I don't know, but you could always try it.

Post Comment

Capcha