Tricky Control Validation Issue

M

Mark Sandfox

I have a tricky control validation issue. I have probably designed this the
wrong way but here is what I have.

I have 6 TextBoxes; tbPN, tbA, tbC, tbS, tbZ, tbDOB and there are 20 of each
with a corresponding number following the names. (Couldn't get ASP.NET to
recognize a control array)

The question is: How do I get the tbA, tbC, tbS, tbZ, & tbDOB to be
required if (AND ONLY IF) tbPN has text? I have tried in the past to get
VBScript to intertwine with ASPX but to no avail. I must be missing the
bigger picture here. Thank you in advance for your help and guidance.
 
P

Peter Blum

Microsoft's predefined validators do not know how to sense a value in
another control before enabling themselves.

A custom validator will let you write this but you have to recreate the
logic of the original validator that you are replacing, including on the
client-side.

I build a replacement to Microsoft's validators designed to get the job
done, even difficult tasks like this. "Professional Validation And More"
(http://www.peterblum.com/vam/home.aspx) includes 22 validators. All have a
new property, Enabler, where you setup a rule that enables them. In your
case, the rule is to check if tBPN has text. It supports client-side
validation on many more browsers too, not just IE and IE/Mac.

Even if you aren't looking for a replacement, it helps to know the
limitations of the controls you are using to make better design decisions. I
put together a list at http://www.peterblum.com/vam/valmain.aspx.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top