By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,509 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

Required Field Validator for multiple controls

P: n/a
Is there a way of having a required field validator check to see if at
least one of a set of controls has information in it? I'm sure this can
somehow be done using a custom validator, but would like a validator
that worked like as a custom tag:

<MyValidator:MultipleRequiredFieldValidator
ControlsToValidate="TextBox1,TextBox2,TextBox3" ErrorMessage="You did
not fill in one of the required fields: TextBox1,TextBox2,TextBox3"
runat="server"/>

If not, how could this be done server-side?

Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
> Is there a way of having a required field validator check to see if at
least one of a set of controls has information in it? I'm sure this can
somehow be done using a custom validator, but would like a validator
that worked like as a custom tag:

<MyValidator:MultipleRequiredFieldValidator
ControlsToValidate="TextBox1,TextBox2,TextBox3" ErrorMessage="You did
not fill in one of the required fields: TextBox1,TextBox2,TextBox3"
runat="server"/>

If not, how could this be done server-side?


The validator controls validate one control at the time. Hence the property
is named ControlToValidate and not ControlsToValidate. You can use the
ValidSummary control create a list of all the controls that are invalid.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.