You can use a custom validator control. For example:
1. add two textboxes to your form (textBox1 and textBox2)
2. add a custom validator controls (CustomValidator1)
3. double click on the CustomValidator1 and create the following:
private void CustomValidator1_ServerValidate(object source, System.Web.UI.WebControls.ServerValidateEventArgs args)
{
if(args.Value!=""&&TextBox2.Text=="")
{
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
This should be what you are looking for. Hope it helps.
Alan Washington
http://www.aewnet.com I have a page with two textboxes.
What would be a simple method of requiring entry for none or both?
In other words, it is ok to leave both empty, but an entry is made in one,
then the other must have an entry also.
--
Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
User submitted from AEWNET (
http://www.aewnet.com/)