Reputation: 3678
i have two check boxes with male/female and i would like to add a required field validator for them so if none is checked then a custom error appears, i can already do this but with one control not two.
thanks
Upvotes: 4
Views: 6152
Reputation: 3678
All I needed to do was instead of adding two separate CheckBox
s ,I needed to add a CheckBoxList
:
and then use a normal RequiredFieldValidator
on the CheckBoxList
:
Upvotes: 2
Reputation: 11
You'll need to use the CustomValidator with a ClientValidationFunction
http://forums.asp.net/t/1402179.aspx
You'll need to write a custom control or use one that's already made:
-http://www.codeproject.com/KB/validation/MultiDependValidator.aspx
Upvotes: 1