Simply put, Checkboxes are not supported by the predefined validators. You
can write your own code with a CustomValidator to detect the state of the
checkbox and report an error.
My replacement to Microsoft's validators, Professional Validation and More
(
http://www.peterblum.com/vam/home.aspx) includes a CheckStateValidator for
checkboxes and radiobuttons amongst the 22 validators it offers. I wrote
Professional Validation And More after finding numerous limitations in
Microsoft's validators that required custom coding and creative hacks to
resolve. I put together a list of the limitations that I've found here:
http://www.peterblum.com/vam/valmain.aspx.
--- Peter Blum
www.PeterBlum.com
Email:
PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
"Asha" <As**@discussions.microsoft.com> wrote in message
news:CC**********************************@microsof t.com...
greetings
i want to use the required field validator control to validate a checkbox.
here is the code implemented.
<asp:RequiredFieldValidator ID="rfv" ControlToValidate="chkDistiAudit"
ErrorMessage="error" runat="server" />
<asp:checkbox id="chkDistiAudit" runat="server" CssClass="objControl_left"
Width="100px" Text="Disti Audit" Checked="True"></asp:checkbox>
and below is the error return
Control 'chkDistiAudit' referenced by the ControlToValidate property of
'rfv' cannot be validated.
can somone please help me out here?.
thanks...