You need to return "
true" after you clear the TextBox value.
Just add this line at the end of your JavaScript function which you call
onClientClick
of the button.
return true;
Also, it's important to call the JavaScript function like this:
<asp:Button ID="btnSubmit" runat="server" Text="Submit" Width="70px" OnClick="btnSubmit_Click" OnClientClick="return validateData();" />
Above call is in the form
return JavaScriptFunction();
.
JavaScript function:
function validateData()
{
return true;
}
Hope this helps!