Two simple validation questions

A

Alan Silver

Hello,

A couple fo questions about the easiest way to do some tasks. I'm sure
both of these can be done with custom controls, but can they be done
more easily with another validation control?

1) How would I go about building a validation control that checked that
a number was entered in a textbox only if a dropdown control was set to
a certain value? For example, say the dropdown allowed them to choose a
product, and product A requires a height entering, but none of the
others do. If they choose product A, they must enter a number, if they
choose any other product, they don't need to.

2) What if I want to require a textbox to be filled depending on the
value of another textbox? For example, if I have a textbox for customer
account number, then if they enter a number, they don't have to enter
their address as we will know it from their account. Non-customers would
not have an account number, so would leave the field blank and be
required to enter their address.

TIA
 
B

Brock Allen

Sounds like you should use the CustomValidator and write all of this custom
logic in your page.
 
A

Alan Silver

Brock said:
Sounds like you should use the CustomValidator and write all of this
custom logic in your page.

That's what I thought, but I just wondered if I was missing some easy
way of doing it.

Thanks for the reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top