Hi there,
I am using VS2005 - .NET framework 2.
I have 2 textboxes on a form:
- txtEmailAddr
- txtCustomerNumber
I need to be able to validate that either 1 is populated. I can find lots of examples of validating all fields seperately i.e. :
<asp:textbox id="txtEmailAddr" runat="server" size="40"></asp:textbox><asp:requiredfieldvalidator id="rvEmailAddr" runat="server" display="None" errormessage="Please provide EmailAddr" controltovalidate="txtEmailAddr"></asp:requiredfieldvalidator>
..But I cannot find conditional validation - i.e. if 1 out of the 2 is filled in.
I assume I need a custom validator? but kind find good examples.
Please help.
thanks
david
I am using VS2005 - .NET framework 2.
I have 2 textboxes on a form:
- txtEmailAddr
- txtCustomerNumber
I need to be able to validate that either 1 is populated. I can find lots of examples of validating all fields seperately i.e. :
<asp:textbox id="txtEmailAddr" runat="server" size="40"></asp:textbox><asp:requiredfieldvalidator id="rvEmailAddr" runat="server" display="None" errormessage="Please provide EmailAddr" controltovalidate="txtEmailAddr"></asp:requiredfieldvalidator>
..But I cannot find conditional validation - i.e. if 1 out of the 2 is filled in.
I assume I need a custom validator? but kind find good examples.
Please help.
thanks
david