How to load data back from database to checkbox group?
Using same form with ChronoConnection with field name
TestData2[valikko[]]
I guess this is somehow wrong way to do this?
Form also has field TestData2[Name]. That works just fine.
-kmikko
Hi kmikko,
First of all, please update CCv5 to the latest version.
The field name should be:
TestData2[valikko][]
The problem is that if you have a "Handle arrays" action before the save action then the values are concatenated using commas, and now you will need to separate them again, using PHP code inside a "custom code" action before the "HTML" action:
<?php
$form->data["TestData2"]["valikko"] = explode(",", $form->data["TestData2"]["valikko"]);
Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Thank you! Works like dream.
-kmikko
What if I'm using a different form to retrieve the data? I used one form with a Handles Array and DB Write to create the table. My second form uses DB Read to extract a record. How do I extract the individual elements from the concatenated field?
I tried adapting the custom code shown for my situation but it didn't work. Not knowing much about php, however, means I could have screwed it up. In $form->data["TestData2"]["valikko"] are TestData2 the form name and valikko the field name?