473,385 Members | 2,013 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,385 software developers and data experts.

Custom validator on multiple fields?

Hi everyone, is it possible to make a custom validator work on multiple
fields?

I have 3 input text boxes, I would like a validator that checks to ensure at
least 1 of them contains informaion before allowing the form to be
submitted.

Any help apprecated,

Kind regards
Taz
Feb 12 '06 #1
2 3651
Hi,

you can use CustomValidator so that don't specify the ControlToValidate at
all. In that case, you'd sort of hard-code in the validation logic which
controls you check for with it. That way you can check multiple of them.

I've also developed (though a long time ago, so the quality of code is what
it is) such validator which can take the controls to be validated as
comma-separated string
http://authors.aspalliance.com/jotek...1/article.aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Tarun Mistry" <no****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi everyone, is it possible to make a custom validator work on multiple
fields?

I have 3 input text boxes, I would like a validator that checks to ensure
at least 1 of them contains informaion before allowing the form to be
submitted.

Any help apprecated,

Kind regards
Taz

Feb 12 '06 #2
Many thanks Teemu, this is exactly what I needed.

Appreciate your help.

Regards
Taz
Feb 12 '06 #3

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

Similar topics

1
by: Michael ALbanese | last post by:
I am developing a telephone directory for my company. I have Fist Name, Last Name, Department and Phone Number as fields. A user can search by entering data into any one, or combination of these...
1
by: Arvind P Rangan | last post by:
Hi All, May be this Question is answered,but please if anyone knows it let me know. I have multiple controls which has custom validator. But i want one to trigger only when the relative action...
9
by: Alex Shirley | last post by:
Hi there I’m simply trying to check for a blank or empty value in a textbox on my webform. In this instance I do not want to use a requiredfieldvalidator, I want to use a customvalidator (as I...
9
by: Mike Moore | last post by:
We have 3 fields on our web form that makeup what could be a duplicate entry. We would like to look at these three fields that the user enters and check in the database to see the information in...
1
by: Jim Heavey | last post by:
Can I create a generic Javascrip custom validator in which I can pass multiple parameters? Looking at examples, it does not appear that I can. I want to create a custom validator which will look...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
5
by: Mattyw | last post by:
Hi, I'm relatively new to Web Forms, I have been using Required Field Validators and Regular Expression Validators on a Web Form I am developing and everything works as expected using Visual...
1
by: Microsoft News Group | last post by:
I am trying to validate two textboxes as their values are the same, or both are null do not insert the data. I do not just want one to try to be null, I want both of them, so the requirevalidator...
3
by: Andy | last post by:
Hi folks, I have a customvalidator control that works properly if it isn't contained in an ASP:TABLE. But, when I place it inside an ASP:TABLE, I find that _ServerValidate doesn't get fired,...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.