Question
Dynamic checkboxes
I want to dynamically generate checkboxes from a query :
<cfloop query="qryGet_Error">
<cfoutput>
<cfinput type="checkbox" name="error_id" value="#qryGet_Error.error_id#">#qryGet_Error.error#<br>
</cfoutput>
</cfloop>
In the action page, I would have something like this, but how would I setup the select query, based on each checkbox value ?
<cfif isDefined("form.error_id")>
<cfloop list="#form.error_id#" index="error_id_value">
<cfquery name="qry" datasource="datasource">
For example, the query would have to be select if error_id = '1' or error_id = '3' or error_id = '8', etc., based on which checkboxes were selected.
I do not know how to set this up.
<cfelse>
no checkboxes were selected, display message
</cfif>
Thanks
<cfloop query="qryGet_Error">
<cfoutput>
<cfinput type="checkbox" name="error_id" value="#qryGet_Error.error_id#">#qryGet_Error.error#<br>
</cfoutput>
</cfloop>
In the action page, I would have something like this, but how would I setup the select query, based on each checkbox value ?
<cfif isDefined("form.error_id")>
<cfloop list="#form.error_id#" index="error_id_value">
<cfquery name="qry" datasource="datasource">
For example, the query would have to be select if error_id = '1' or error_id = '3' or error_id = '8', etc., based on which checkboxes were selected.
I do not know how to set this up.
<cfelse>
no checkboxes were selected, display message
</cfif>
Thanks
