Tom,
If you want a validator that acts on the checkboxlist exactly the same way
as the built in validator works on a radio button list (and lets you set how
many checkboxes need to be selected) I built one and am giving it away,
including source, on my website,
www.aboutfortunate.com. If you'd like to
download it click the "Code Library" button at the top of the page and then
click the "Check Box Required Field Validator" button that will appear in
the menu on the left.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"tshad" <ts**********@ftsolutions.com> wrote in message
news:um**************@TK2MSFTNGP14.phx.gbl...
"tshad" <ts**********@ftsolutions.com> wrote in message
news:er**************@tk2msftngp13.phx.gbl... Can you use a Required Validator on a CheckBoxList?
You can on a RadioButtonList.
But when I try on my CheckBoxList I get the error:
Control 'RFPServiceTypes' referenced by the ControlToValidate property of
'ServiceTypesCheck' cannot be validated
<asp:CheckBoxList id="RFPServiceTypes" CellPadding="0" CellSpacing="0"
runat="server"/>
<asp:RequiredFieldValidator id="ServiceTypesCheck"
ControlToValidate="RFPServiceTypes"
text = "You Must Choose At Least One Service Type"
runat="server"/>
I just want to make sure that one of the checkboxes are checked.
I found that you apparently can't.
But I found a couple of places that show you how to create a custom
validator that does the trick.
Tom
Thanks,
Tom