how to loop to get value of all checked checkboxes?


i non-techic trying fix work. appreciated.

 

i have form checkboxes (4 check boxes). sumbits fine. sql db updated , data displayed on webpage w/o problem. when go edit entry, on edit form, (if more 1 checkbox selected oringally), non of checkboxes checked. if 1 checkbox selected orinally, checkbox selected. missing? know suppose use loop checked checkbox values, have no idea how.

here code 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

jayyaj wrote:

 

however when go edit entry, on edit form, (if more 1 checkbox selected oringally), non of checkboxes checked. if 1 checkbox selected orinally, checkbox selected.

you've given checkboxes same name. give them each unique name , able access them individually. current standards require unique id, can (but not have to) same name.

 

the "or" characters in code not doing anything. can safely delete them.



More discussions in Getting Started


adobe

Comments

Popular posts from this blog

Thread: Can not create raid array: mdadm: no raid-devices specified.

Thread: HOW TO: Package and theme GTK+ / Gtkmm apps in Linux for Windows

Thread: Twinview issues