I need to disable a button once it\'s clicked so the user can\'t click it more than once. (My application is written in MVC ASP.NET, I\'ve done this in a normal ASP.NET appl
To submit form in MVC NET Core you can submit using INPUT:
To make it a button I am using Bootstrap for example:
To prevent sending duplicate forms in MVC NET Core, you can add onclick event, and use this.disabled = true; to disable the button:
If you want check first if form is valid and then disable the button, add this.form.submit(); first, so if form is valid, then this button will be disabled, otherwise button will still be enabled to allow you to correct your form when validated.
You can add text to the disabled button saying you are now in the process of sending form, when all validation is correct using this.value='text';: