I have a button that is executing some insertion into the database.
Problem is when user fills the form and click on the buttons more than one time insertion process executed multiple times.
So i disabled the button on "OnClientClick" of button using script but it does not execute the server side Click event.
here is my button :
<asp:Button ID="btnContinue" runat="server" Text="Continue To Application >>" OnClick="btnContinue_Click" ValidationGroup="criteria" OnClientClick="DiableButton(this)"></asp:Button>
function that disables the button
function DiableButton(btn) {
$(btn).attr("disabled", "disabled");
$("[Id$='hfDisableBtn']").val($(btn).attr("id"));
}
function that enables the function that is called from the server side after executing insertion
function EnableButton() {
var btn = $("[Id$='hfDisableBtn']").val();
$(btn).removeAttr("disabled");
$("[Id$='hfDisableBtn']").val("");
}
what i want is
1) first disable button on click if all the validation satisfied (like Require filed validator)
2) then call the server side click event of that same button
3) enable that button after executing server side click event
How can i achieve this ???
Please help me Thanks is advance