how to loop to get value of all checked checkboxes?
I am a non-techic trying to fix something for work. Your help is really appreciated.
I have a form with checkboxes (4 check boxes). Everything sumbits fine. SQL db is updated perfectly and data is displayed on webpage w/o any problem. However when I go to edit an entry, on the edit form, (if more then one checkbox were selected oringally), non of the checkboxes are checked. If only one checkbox was selected orinally, that checkbox is selected. What am I missing? I know I am suppose to use loop to get all checked checkbox values, but I have no idea how.
Here is my code so far.
<input type="checkbox" name="colors" value="red" <cfif #getResultSet.colors# EQ "red">checked</cfif>>red
<input type="checkbox" name="colors" value="blue" OR<cfif #getResultSet.colors# EQ "blue">checked</cfif>>blue
<input type="checkbox" name="colors" value="green" OR<cfif #getResultSet.colors# EQ "green"></cfif>>green
<input type="checkbox" name="colors" value="yellow" OR<cfif #getResultSet.colors# EQ "yellow">checked</cfif>>yellow
