How To Disable All Submit Buttons of All Forms By jQuery



jquery-logo

Hi Friends, Some days ago I need to do all submit button disable of all forms by jQuery,So I tried to search about it ,I already found that “Disable submit button by jQuery” but by that we can make disable only one submit button which is inside a form which formid passed to code. But I need to make all submit button disable when clicking on something and doing some event. So below is code by which we can make all submit button disable of all form.


$('form').submit(function(){

$('input[type=submit]', this).attr('disabled', 'disabled');

});

Above is code by which we can disable all submit button disable when any form submit. In above code we pass ‘form’ selector it means all forms, so when any form submit all form submit buttons will be disabled.

I hope this post helpful for someone. If you have any question then you can ask me anytime or post it in comment.

Also I am WordPress Developer, Freelance PHP Developer having more than 3 years of experience, So if you want to do any projects then you can contact me.

Hostgator Hosting in 1 Cent Coupon Code – “1CENTHECOUPON” (Without Quotes).

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback .