simmerdown
Programmer
I first generate a list of checkboxed items based on a query
<cfoutput query="equiplist">
<tr>
<td><input type="checkbox" name="equip_item" value="#Item#"></td>
<td class="eq1">#Item#</td>
</tr>
</cfoutput>
like so. The name ("equip_item"
is of course applied to every checkbox in the list.
This is submitted to a page which inserts the items and a userID into my results table ... and we come to my dificulty. The values from the checkboxes are all combined into one value, since all my checkboxes have the same name. Thus I end up with a string such as "Audio CD Player,DVD Player,Slide Projector" as my (single) value.
Is it within the realm of possibility to
a) give each checkbox a unique name on the fly, or
b) split the values up again so that each one can be inserted into the db as a distinct value? I'm even thinking that some sort of looping insert, placing the userID and a single item value on each row, might be a good way to go ... if you could be kind enough to give me a start.
Thanks in advance. I've looked around, but haven't seen this problem addressed specifically.
<cfoutput query="equiplist">
<tr>
<td><input type="checkbox" name="equip_item" value="#Item#"></td>
<td class="eq1">#Item#</td>
</tr>
</cfoutput>
like so. The name ("equip_item"
This is submitted to a page which inserts the items and a userID into my results table ... and we come to my dificulty. The values from the checkboxes are all combined into one value, since all my checkboxes have the same name. Thus I end up with a string such as "Audio CD Player,DVD Player,Slide Projector" as my (single) value.
Is it within the realm of possibility to
a) give each checkbox a unique name on the fly, or
b) split the values up again so that each one can be inserted into the db as a distinct value? I'm even thinking that some sort of looping insert, placing the userID and a single item value on each row, might be a good way to go ... if you could be kind enough to give me a start.
Thanks in advance. I've looked around, but haven't seen this problem addressed specifically.