Advertisement

06.01.2008 at 11:40PM PDT, ID: 23449033
[x]
Attachment Details

asp:RegularExpressionValidator

Asked by paulj1999 in .NET

Ok, another question:

asp:RegularExpressionValidator....I'm trying to use it in the below code, but it accepts empty strings.  The error string comes up, but the form still submits.  What should I be doing differently?

ThanksStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
<form id="form1" runat="server">
 
<asp:TextBox ID="txtFirstName" runat="server" CssClass="formfield" Width="320px" />
 
<asp:RequiredFieldValidator ID="RequiredFieldValidatorFirstName" runat="server" ErrorMessage="Please enter a first name"            ControlToValidate="txtFirstName" />
 
<asp:ImageButton ID="SubmitRequest" runat="server" ImageUrl="~/Images/bt_submit_request.jpg"                               OnClick="SubmitRequest_Click"                           onclientclick="parent.window.location='/Main.aspx?view=3';" />
 
</form>
[+][-]06.02.2008 at 12:29AM PDT, ID: 21690149

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: .NET
Sign Up Now!
Solution Provided By: naspinski
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628