Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Custom validator on multiple fields?

Reply
Thread Tools

Custom validator on multiple fields?

 
 
Tarun Mistry
Guest
Posts: n/a
 
      02-12-2006
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


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      02-12-2006
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" <> wrote in message
news:%...
> 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
>



 
Reply With Quote
 
 
 
 
Tarun Mistry
Guest
Posts: n/a
 
      02-12-2006
Many thanks Teemu, this is exactly what I needed.

Appreciate your help.

Regards
Taz


 
Reply With Quote
 
sofiat9 sofiat9 is offline
Junior Member
Join Date: Mar 2008
Posts: 2
 
      03-24-2008
Hi Teemu, I added the code above to my vb.net project. I need to make user the user enters at least one of 3 textfield values. However, I'm getting the following two errors: Error1 Element 'EmptyControlCompareValidator' is not a known element. This can occur if there is a compilation error in the Web site. Error2 Unknown server tag 'asp:EmptyControlCompareValidator'. Any help would be appreciated. Thanks! Sofia
 
Reply With Quote
 
sofiat9 sofiat9 is offline
Junior Member
Join Date: Mar 2008
Posts: 2
 
      03-25-2008
Hi, I added the code above to my vb.net project. I need to make user the user enters at least one of 3 textfield values. However, I'm getting the following two errors: Error1 Element 'EmptyControlCompareValidator' is not a known element. This can occur if there is a compilation error in the Web site. Error2 Unknown server tag 'asp:EmptyControlCompareValidator'.

I added the following code as well on the top of my source code:

<%@ Register Assembly="EmptyControlCompareValidator" Namespace="MansoftValidators" TagPrefix="cc1" %>

Any help would be appreciated. Thanks! Sofia
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Struts Validator - creditCard validator smrimell@gmail.com Java 4 02-13-2007 08:32 PM
How to get custom control to work with custom validator Scott Yenor ASP .Net Web Controls 0 01-27-2004 12:37 AM
Custom Validator Issue Arvind P Rangan ASP .Net 1 11-12-2003 03:28 PM
custom validator Mike P ASP .Net 2 11-05-2003 03:25 PM
Custom Validator Serdar Kalaycý ASP .Net 1 07-08-2003 01:36 PM



Advertisments