Forum Moderators: open

Message Too Old, No Replies

Validating Checkboxes in a Form

How to make sure at least one is checked?

         

Witt

4:26 am on Nov 14, 2006 (gmt 0)

10+ Year Member



OK - I have a form with 12 checkboxes, and I want to make sure that whenever someone submits the form that s/he has checked at least one of them. To complicate matters, however, this form seems to be cold fusion or database-driven. Also, I do not see 12 individually named checkboxes in the code, but only this:

<CFOUTPUT QUERY="select_position_category">
<INPUT TYPE="checkbox" NAME="ogn_position_category" value="#NAME#">
&nbsp;#NAME#<br>
</cfoutput>

Where I would normally perform a "...checked == false" function through each checkbox, here I don't seem to have that option - but to the person filling in the form, there are still 12 checkboxes, and I need at least one of them to be checked when they hit "submit."

Any ideas out there?
Many thanks.

coopster

8:53 pm on Nov 20, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, Witt.

Not a lot of help here yet. Yes indeed, it certainly appears to be cold fusion. Did you have a look through the CF help docs yet?