Disabling the button after once click

后端 未结 9 1737
遥遥无期
遥遥无期 2020-11-28 09:32

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

9条回答
  •  一个人的身影
    2020-11-28 10:31

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

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

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

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

    or

    $('#btnSubmit').removeAttr("disabled");
    

提交回复
热议问题