Custom validator on multiple fields?

T

Tarun Mistry

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
 
T

Teemu Keiski

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/joteke/validationarticle1/article.aspx
 
T

Tarun Mistry

Many thanks Teemu, this is exactly what I needed.

Appreciate your help.

Regards
Taz
 

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

Top