validating checkboxes
I have a form created dynamically from a database. Folk using the form select several of the checkboxes and submit the form.
</head>
<cfquery name="criteria_list1" datasource="my_data">
select * from CRITERIA
</cfquery>
<body>
<cfform id="form1" name="form1" method="post" action="selection.cfm">
<table width="98%" border="0">
<tr>
<td colspan="2"><h2>Please select your criteria (Select as many as you wish)</h2><</td>
</tr>
<cfoutput query = "criteria_list1">
<tr>
<td>#CRITERIA_NAME#</td>
<td><cfinput type="checkbox" name="checkbox" value="#id#" /></td>
</tr>
</cfoutput>
</table>
<p>
<input type="submit" name="Submit" value="Submit" />
<input type="reset" name="Submit2" value="Reset" />
</p>
</cfform>
</body>
This works fine except if someone does not tick any of the boxes. If this happens an error is returned: "Element CHECKBOX is undefined in FORM."
Could anyone tell me how I could validate the form to make sure that people using it tick at least one checkbox.
Thanks,
Paul.
