Optional Validators - Is this possible?

I have a form with three checkboxes at the top and four textboxes below them.  If the first checkbox is not checked, the first textbox is required.  If the second checkbox is not checked, the second and third textboxes are required.  If the third checkbox is checked, the fourth textbox is required.  My problem is how to validate them.  If I put a required field validator on all of the checkboxes, the validation expects all four textboxes to have data, regardless of the state of the checkboxes.  If I use the checkbox code to disable (enable = false) the individual validators as required, the validation summary no longer displays.  And I'm not even sure that this is a valid approach.

Any ideas or nudges in the right direction would be greatly appreciated.
BamaErnAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joel CoehoornDirector of Information TechnologyCommented:
You'll have to use custom validators for the textboxes.
0
BamaErnAuthor Commented:
Why?  Is there an article or another thread you can point me to?
0
BamaErnAuthor Commented:
I found a solution.  I can disable the appropriate validators BUT I have to set both .enabled = false and .EnableClientScript = false.  The non-appearing summary was a red herring in that it was incorrectly placed in a div that had it's visible set to false under certain conditions.

This article confirmed to me that I could do this: http://msdn2.microsoft.com/en-us/library/bt244wbb(VS.80).aspx. (Sorry, not sure how to embed a link.)
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

BamaErnAuthor Commented:
Guess it handles the link automatically.  Nice.
0
Alpesh PatelCommented:
hi
you can use the ValidationGroup attribute for controls
you can the value of  three textbox's attribute as value/none on click event of associated checkbox
all that textbox are associated with commandbutton through which u are going to validate them.

button is validate only those textbox which has ValidationGroup attibute......

thats it

thanx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BamaErnAuthor Commented:
Simpler than the method I came up with.  This is better than my solution so I'm giving you the points.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.