What this will do is: If the user checks a checkbox in the CheckBoxList
the textbox will hold the value of the SelectedIndex (or if multiple are
selected, the smallest index of all the checked checkboxes). As long as the
value of the SelectedIndex property of the CheckBoxList is > -1 then you
want the form to submit. If the value of the SelectedIndex property = -1
then none of the checkboxes are checked. The RangeValidator will ensure
that the value in the textbox (which is the value of the SelectedIndex of
the CheckBoxList) is between 0 and the number of checkboxes.
I'm not sure if there is an easier/simpler way to achieve what you want, but
this will work.
Let me know if this doesn't make sense.
Shannon
--
Shannon Calma, MCSD
Clarity Consulting
http://www.claritycon.com
"FG3" <fran...@yahoo.com> wrote in message
news:23c601c1b32e$e2514910$39ef2ecf@TKMSFTNGXA08...
> I have a data-bound checkboxlist on a form and i want to
> make the checking of at least one checkbox required.
> apparently the <asp:requiredfieldvalidator> does not work
> with checkboxlists (although it does with
> radiobuttonlists).
>
> any ideas?
>
> Frank
See this for specifics:
ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemwebuiwebcontrolscustomvali
datorclasstopic.htm