Javascript

JavaScript to disable button after click

<script language=”javascript” type=”text/javascript”> function disableButton(sender,group) { Page_ClientValidate(group); if (Page_IsValid) { sender.disabled = “disabled”; __doPostBack(sender.name, ”); } } </script> and in Html <div> Enter Name :- <asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox> <asp:RequiredFieldValidator ID=”RequiredFieldValidator1″ runat=”server” ControlToValidate=”TextBox1″ ErrorMessage=”RequiredFieldValidator”>*</asp:RequiredFieldValidator><br /> <asp:Button runat=”server” ID=”btnSave” Text=”Save” OnClick=”Save” OnClientClick=”disableButton(this,”)” UseSubmitBehavior=”false” /> </div> If there is Validation Group it will be like this :- AddContinue Reading “JavaScript to disable button after click”