Forums

How to save Check-box data in a table?

benblur4 06 Aug, 2009
My check-boxes are working, but they are not saving to the database table that I created. I can see the results clearly in the email of the form, but the table shows them as blank. What should I do to fix this?
Thanks!
Ben
GreyHead 07 Aug, 2009
Hi Ben,

You probably need to turn on the 'Let ChronoForms handle your arrays' option.

Bob
benblur4 07 Aug, 2009
Thanks for the response, but the "ChronoForms handle my posted arrays:" option is already set to "yes." Is there anything else that I could try? FYI: This is set to yes on all child forms and the mother form. Is this a correct setup? Or should it only be set on the mother form?
Thanks,
Ben
benblur4 07 Aug, 2009
My debug looks like this:
Form passed first SPAM check OK
Form passed the submissions limit (if enabled) OK
Form passed the Image verification (if enabled) OK
Form passed the server side validation (if enabled) OK
$_POST Array: Array ( [check0] => Array ( [0] => Blue Prints [1] => CPVC [2] => Indirect Waste [3] => Floor Drains [4] => Service Truck [5] => Slab Work [6] => Catch Basin/Grease Interceptors [7] => Carriers/Supports [8] => Brazing [9] => Electric Welding [10] => Water Heaters [11] => 12 R Block Dies [12] => Rigid Pipe Machine ) [check1] => Array ( [0] => Schools [1] => Industrial Plants ) [radio8] => No [radio9] => No [radio10] => Yes [foremanWhere] => [foremanWhen] => [button_9] => Next Step [cfformstep] => 2 [d4b2fe9d5aa3dd84926b34edc0f5afdd] => 1 [1cf1] => fb323688c91097d110b66f0696822f43 [chronoformname] => motherForm )
$_FILES Array: Array ( )
Form passed the plugins step (if enabled) OK

Thanks again for the help!
Ben
GreyHead 16 Sep, 2009
Hi Ben,

Sorry for the long delay in getting back to this.

I just built a test set of forms in the latest ChronoForms release.

I have two child forms each with one text input and an array of three checkboxes. Apart from changing the ids and names to make sure that I can distinguish the inputs and th etwo forms use different field names these forsm are identical and are exactly as created by the wizard.

I then created a mother form, set up the multi-page plugin on the mother form and enabled it.

I created a database table based on Child form 1 and added the two field from child-form 2 in the set up.

I enabled the DB Connection on the mother form only.

I checked that 'Have CF handle arrays' is set to Yes on the mother form (and probably is for the child forms too).

I went to the mother form, entered some data in steps 1 & 2 and, after submitting step 2 all of the data including the checkbox results is in the database.

I don't see anything here that is critically different from your setup except that this one seems to work OK :-(

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