attach regularexpressionvalidator to a textbox base on dropdownlist selected item?

R

rockdale

Hi, all

Is there a way to dynamically attach a regularexpressionvalidator to a
textbox base on dropdownlist selected item?

Let's say I have a dropdownlist list all contact type - phone, cell,
email ...etc and a textbox that allow user to type in their contact
info. When they choose email, I want attach the
regularexpressionvalidator of email to the textbox, when the ddl
selected phone, then I want attach phone regExp to the same textbox.

Any help will be appreciated

thanks
-rockdale
 
A

Andy

I've done this, however, the regular expression validator has to be in
the same container as the listbox is to work. I don't have the code
for this as I've replaced all my validators with custom validators and
have moved the page validation to a single central errorchecking method
in my code behind.

But, it should just be a matter of specifying the control name of the
listbox to validate in the validator property sheet and selecting one
of the Microsoft regular expression templates for the regular
expression.
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top