473,419 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

Tricky Control Validation Issue

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.
Nov 19 '05 #1
2 1352
Have you looked into custom validators?

http://msdn.microsoft.com/library/de...omfunction.asp

"Mark Sandfox" wrote:
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.

Nov 19 '05 #2
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: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Mark Sandfox" <No****@NoSpam.com> wrote in message
news:Bq*****************@newssvr31.news.prodigy.co m...
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.

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: shimonsim | last post by:
Hi, I need to upload pictures from client machine and I am using HtmlInputFile control I set validator to make sure that file has correct expention but if one of the files has incorrect extention...
7
by: A.M | last post by:
Hi, I have a validation control in my page that upon any invalid data, it disables all buttons in the page. basicly i don't have any postback in the page if the validator finds any error. How...
2
by: Sunil Sabir | last post by:
Dear All, I am using ValidationSummary,RequiredField Validator and Regular Expression Validator in my ASP.net form. I want to display error messages only in the ValidationSummary Control. But...
3
by: c676228 | last post by:
Hi all, If I developed a phone user control which has requiredfieldvalidator, regularexpressionvalidator etc. The quesiton is if on a web form which have three phone fields and only any one of...
3
by: ilockett | last post by:
The background: I have a web app with a simple master page that contains just one content placeholder. I have created a web form that then uses this master page. Within the content...
4
by: TS | last post by:
I am creating a User control and i create some dynamic controls in the init handler. one of the controls is a custom validator which i assign a serverValidate event handler. I usally always do my...
1
by: rn5a | last post by:
I have created a custom control button which when clicked displays a message in the JavaScript alert dialog. I could successfully compile the VB class file into a DLL & also could add it to the...
10
by: gweasel | last post by:
What is the best way to apply a Validation Rule - or rather, where is the best place to put it? Is there an advantage to putting it on the field in the table vs setting the validation rule on the...
1
by: Craig Buchanan | last post by:
I have a Web User Control (.ascx file) that I need to valid using a CustomValidation control. Moreover, I would like use client and server validation, if possible. I have the logic for the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.