Speaktech.in

How to disabled submit button after clicked

Some of the users press a few times on the submit button to make sure the button is surely clicked, and causing the double form submission issue. The common solution is disables the submit button after user clicked on it.

1. Enable / Disable submit button

1.1 To disable a submit button, you just need to add a disabled attribute to the submit button.

$("#btnSubmit").attr("disabled", true);

Copy

1.2 To enable a disabled button, set the disabled attribute to false, or remove the disabled attribute.

$('#btnSubmit').attr("disabled", false);or$('#btnSubmit').removeAttr("disabled");

Copy