john
john

Reputation: 295

how to make RequiredFieldValidator control two validate two control

    Are you required applicant?
<asp:CheckBox ID="CheckBox1" runat="server" Text="Yes" />
<asp:CheckBox ID="CheckBox2" runat="server" Text="No" />

Actually this is code, i do not know why they use two Checkbox instead of Checkboxlist, but they told me do not change it. and make the two checkbox required(using RequiredFieldValidator). I know how to use RequiredFieldValidator, but how can i make RequiredFieldValidator control two Checkbox, only pass if one of them selected

Upvotes: 2

Views: 1795

Answers (1)

mcknz
mcknz

Reputation: 477

Required Field Validator only works on one control at a time -- you'll want to use Custom Validator, or just write your own client/server validation independent of the ASP.NET validators.

See also:

How do I make a checkbox required on an ASP.NET form?

javascript for two checkboxes in aspx

Upvotes: 2

Related Questions