jqueryexample.com Disables submit button on form submission - jqueryexample.com

Disables submit button on form submission by jqueryuser

Below are the jQuery code which you can use to disables submit button on form submission:

JQuery:

$('#myform').submit(function(){
    $('input[type=submit]', this).attr('disabled', 'disabled');
});

HTML:
<form name="myform" action="/" method="post"
onsubmit="document.getElementById('submit_button').disabled = 1;">
 </form>
Did you like this? Share it:

Discussion

No comments yet, be the first.

Leave a Comment