Forums

How can I save the values of a checkboxes field in multiple rows

wiva 07 Dec, 2020
I’m trying to make a attendance form to register the absence / presence of people in daycare
I just want to explore the possibilities of registering as simple as it can be for the people who has to fill in the form.
Afterwards I want to collect the data to count and calculate in MySQL.
In a simple form i have a calendar field to select the date and a (dynamic) checkboxes field to check the names of the person(s)

I save the data with a save data in a loop action
The data is saved in the table but all values in one field. [“4”,”6”,”7”,”12”] and a date field [2020-12-05]
I would like to save them in separate rows with one field one of the values and also the date field like
[“4”] , [2020-12-05]
[“6”] , [2020-12-05]
[“7”] , [2020-12-05]
[“12”] , [2020-12-05]
or even better
4, 2020-12-05
6, 2020-12-05
7, 2020-12-05

12, 2020-12-05
Max_admin 19 Dec, 2020
Answer
The Loop data provider should be the checkboxes data: {data:checkboxes_name} and then you use {var:loop_name.value} in the "Data sources" of the "Save data" to get each checkbox value!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.