Hi,
I have a form with textbox, a required field validator and a submit button. The scenario should be, when i submit my form i have to confirm if i want to proceed. So, what i did in submit button was this : <asp:Button ID="SubmitButton" OnClientClick="return confirm('Are you sure you want to proceed?')" runat="sever"></asp:Button>. The problem is that the form didn't validate the textbox if it has value in it.
This is the page look like:
What should I do?
I have a form with textbox, a required field validator and a submit button. The scenario should be, when i submit my form i have to confirm if i want to proceed. So, what i did in submit button was this : <asp:Button ID="SubmitButton" OnClientClick="return confirm('Are you sure you want to proceed?')" runat="sever"></asp:Button>. The problem is that the form didn't validate the textbox if it has value in it.
This is the page look like:
HTML:
<form id="Form1" runat="server">
<asp: TextBox ID="TextBox1" runat="server" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="This field is required">Required</asp:RequiredFieldValidator>
<asp:Button ID="SubmitButton" OnClientClick="return confirm('Are you sure you want to proceed?')" runat="sever"></asp:Button>
</form>