0

it is such that I have to find out whether you have "clicked" of the checkbox if it is empty or not, because if it is empty then it should come up with an error that you need to check on before you can move forward.

<div class="checkbox pi-margin-bottom-20">
    <label class="pi-small-text">
    <asp:CheckBox ID="CheckBoxBetingelser" runat="server" /> Jeg accepterer Betingelser for brug
                        <asp:CustomValidator 
                            ID="CustomValidator1" 
                            runat="server" 
                            ErrorMessage="Godkende vores betingelser" 
                            Font-Bold="True" 
                            ControlToValidate="CheckBoxBetingelser" 
                            ValidationGroup="opretbruger"></asp:CustomValidator>
                    </label>
                </div>

What is the error that it says is this: Control 'CheckBoxBetingelser' referenced by the ControlToValidate property of 'CustomValidator1' cannot be validated.

1 Answers1

0

ControlToValidate property should point to input control or left blank for the CustomValidator control.

A reference from MSDN:

and use this for validation checkbox

Community
  • 1
  • 1
ashkufaraz
  • 5,179
  • 6
  • 51
  • 82