Forums

Multiple checked boxes not appearing in database

wfwebmaster 13 Jul, 2009
I'm having issues with multiple checked boxes to save to my database.

For instance, I want someone to let me know if they are available Days, Evenings, or Weekends, or any combination of the three. But whenever multiple check boxes are selected, only the last selection shows up in the database. I already have "ChronoForms handle my posted arrays" set to "Yes".

Here's an example of the code:
* What is your availability? (check all that apply)<br/>
Times: <input type="checkbox" name="availibility" value="Days"/>Days   
<input type="checkbox" name="availibility" value="Evenings"/>Evenings   
<input type="checkbox" name="availibility" value="Weekends"/>Weekends<br/>


What can I do to fix this?
GreyHead 13 Jul, 2009
Hi wfwebmaster,

For checkbox arrays (or multiple selection drop-downs) you need to use an array name e.g. name='availability[]' or you will just get the last selection returned.

Bob
This topic is locked and no more replies can be posted.