How to Disable or Enable Form Submit Button from Jquery

jQuery is one of the best scripting languages which is used for action. You want to disable submit button from the form. Basically, users or disable the submit button from query because of spammer can’t resubmit same content in the form. You can prevent the user to resubmit same content by disable submit button. You can easily save the time to recheck, every content does not duplicate from content. You must be disabled submit button from Jquery. If you want to disable submit button from jQuery, you should follow the steps and code which are mentioned below.

Disable Button with jQuery

$(“#submit_button”).attr(“disabled”, “disabled”);

Enable Button with jQuery

$(“#submit_button”).removeAttr(“disabled”);

On Submit Button Click

$(“#submit_button”).click(function () {
$(‘#target_form’).submit(); //submit form
$(“#submit_button”).attr(“disabled”, “disabled”);
});

Disable Form Submit Button

 

Leave a Reply

Be the First to Comment!

Notify of
avatar

wpDiscuz