S
Stu
I'm using the following validation code in an aspx form page, its the
standard email validation provided with MSVS 2003.
My question is how can I have validation triggered only if something has
been entered in the text box, i.e. email is not a required field, but if the
punter decides to let us have it I'd like it to be validated.
Bit new on C# and MSVS2003, so sorry if its a daft question.
Look forwarded to your replies.
Stu
<asp:regularexpressionvalidator id="RegularExpressionValidator1"
runat="server" ControlToValidate="txtEmail" ErrorMessage="Please enter a
valid email address"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:reg
ularexpressionvalidator>
standard email validation provided with MSVS 2003.
My question is how can I have validation triggered only if something has
been entered in the text box, i.e. email is not a required field, but if the
punter decides to let us have it I'd like it to be validated.
Bit new on C# and MSVS2003, so sorry if its a daft question.
Look forwarded to your replies.
Stu
<asp:regularexpressionvalidator id="RegularExpressionValidator1"
runat="server" ControlToValidate="txtEmail" ErrorMessage="Please enter a
valid email address"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:reg
ularexpressionvalidator>