473,378 Members | 1,500 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,378 software developers and data experts.

Interdependent validation

I have a page that looks like this:

___txtbx1_____ [chkGT]< Your GPA [chkLT]< __txtbx2____
I am trying to implement user data validation.

None of the four controls is required. But I want to validate user
input according to the following logic.

1. If txtbx1 is filled, then it must pass a RangeValidator.
2. If txtbx1 is valid, then chkGT (i.e., checkbox Greater Than) must be
checked.
3. If chkGT is checked, then txtbx1 must be filled and be valid.

4. Similarly, if txtbx2 is filled, then it must pass a RangeValidator.
5. If txtbx2 is valid, then chkLT (i.e., checkbox Less Than) must be
checked.
6. If chkLT is checked, then txtbx2 must be filled and be valid.

7. If both txtbx1 and txtbx2 are valid, then both checkGT and chkLT
must be checked.
8. Vice versa, if both chkGT and chkLT are checked then both txtbx1 and
txtbx2 must be filled and be valid.

This sounds very scary to me. It sounds like it is a recursive check.
Is this logic implementable and how? Thanks.

Nov 19 '05 #1
2 1218
my guess is it would be easier to create a custom javascript function to do
all these checks and call it on OnClick client side event on the submit
button.. All the javascript function will need is few 'if' statements which
would make these comparisons, if check fails display an alert and exit .. if
the check passes continue to next check... (you could try to use
RangeValidator and enable disable it with ValidatorEnable fucntion)

And looks to me it wouldnt need any 'recursive check' ... some of the steps
are repeating. for eg 'txtbx1 is valid, then chkGT ' is in both step 2 & 7..

"an***********@yahoo.com" wrote:
I have a page that looks like this:

___txtbx1_____ [chkGT]< Your GPA [chkLT]< __txtbx2____
I am trying to implement user data validation.

None of the four controls is required. But I want to validate user
input according to the following logic.

1. If txtbx1 is filled, then it must pass a RangeValidator.
2. If txtbx1 is valid, then chkGT (i.e., checkbox Greater Than) must be
checked.
3. If chkGT is checked, then txtbx1 must be filled and be valid.

4. Similarly, if txtbx2 is filled, then it must pass a RangeValidator.
5. If txtbx2 is valid, then chkLT (i.e., checkbox Less Than) must be
checked.
6. If chkLT is checked, then txtbx2 must be filled and be valid.

7. If both txtbx1 and txtbx2 are valid, then both checkGT and chkLT
must be checked.
8. Vice versa, if both chkGT and chkLT are checked then both txtbx1 and
txtbx2 must be filled and be valid.

This sounds very scary to me. It sounds like it is a recursive check.
Is this logic implementable and how? Thanks.

Nov 19 '05 #2
Hi, thank you very much for this nice idea. I can probably use the
same idea for server-side validation, which is my preference.

Sreejith Ram wrote:
my guess is it would be easier to create a custom javascript function to do
all these checks and call it on OnClick client side event on the submit
button.. All the javascript function will need is few 'if' statements which
would make these comparisons, if check fails display an alert and exit .. if
the check passes continue to next check... (you could try to use
RangeValidator and enable disable it with ValidatorEnable fucntion)

And looks to me it wouldnt need any 'recursive check' ... some of the steps
are repeating. for eg 'txtbx1 is valid, then chkGT ' is in both step 2 & 7..

"an***********@yahoo.com" wrote:
I have a page that looks like this:

___txtbx1_____ [chkGT]< Your GPA [chkLT]< __txtbx2____
I am trying to implement user data validation.

None of the four controls is required. But I want to validate user
input according to the following logic.

1. If txtbx1 is filled, then it must pass a RangeValidator.
2. If txtbx1 is valid, then chkGT (i.e., checkbox Greater Than) must be
checked.
3. If chkGT is checked, then txtbx1 must be filled and be valid.

4. Similarly, if txtbx2 is filled, then it must pass a RangeValidator.
5. If txtbx2 is valid, then chkLT (i.e., checkbox Less Than) must be
checked.
6. If chkLT is checked, then txtbx2 must be filled and be valid.

7. If both txtbx1 and txtbx2 are valid, then both checkGT and chkLT
must be checked.
8. Vice versa, if both chkGT and chkLT are checked then both txtbx1 and
txtbx2 must be filled and be valid.

This sounds very scary to me. It sounds like it is a recursive check.
Is this logic implementable and how? Thanks.


Nov 19 '05 #3

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

Similar topics

21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
2
by: wumingshi | last post by:
Hi, When validating an XML instance, sometimes the schema is not enough to expression the validation rules. Additional validation rules may be expressed in an application-specific way. For...
4
by: Tim Meagher | last post by:
I am trying to use both validation controls and to add submit button attributes, but when I add the button attributes, the javascript fpr the validation controls is no longer created for the page. ...
5
by: Gustavo Randich | last post by:
Hello, (Using DB2/LINUX 8.2.0) HOW-TO: recreate a big set of interdependent UDFs... without having to do it manually because of the imposed drop order due to the RESTRICT keyword of the DROP...
14
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
1
by: Paul-André Côté | last post by:
Hi, I've been playing with VBx and VB.NET for a while now but ... Let say in VB.Net, I've never understood how or which event I should use when I update one of two interdependent textboxes. ...
10
by: tuco357 | last post by:
This problem has been vexing me for some time and I thought I should consult the group.... Often times when writing a php script to handle some mysql DB transactions, I must write code that...
4
by: Joergen Bech | last post by:
Just out of curiosity: What is your favorite method of making sure that anything that happens on a form, only happens in response to a single, external event? Take the example below. I have made...
3
by: pburkhart | last post by:
Hello, I have what appears to be a very simple problem, but I just can't seem to get it to work properly! Here's the issue: I have an html based form that uses a little bit of coldfusion to send...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.