Hi
I created a form and used the designer tab to add fields.
The form also reads in data from a table and in a custom box I create checkboxes that take names and values from the data read into the form. The form displays as I want it.
How can I include the values from the checkboxes in the form data when it is saved? At the moment, only data from the controls created in designer view are saved.
Thanks
Mikki
I created a form and used the designer tab to add fields.
The form also reads in data from a table and in a custom box I create checkboxes that take names and values from the data read into the form. The form displays as I want it.
How can I include the values from the checkboxes in the form data when it is saved? At the moment, only data from the controls created in designer view are saved.
Thanks
Mikki
Hi Mikki,
a. Add a Debugger to the On Submit event temporarily so that you can see the data that is being submitted and saved.
b. Click the Delete Cache icon in the Forms Manager toolbar if you have made any changes to the database columns.
c. If there is a Checkbox group in the form then you may need to use a Handle Arrays action to convert the array into a list for saving.
Bob
a. Add a Debugger to the On Submit event temporarily so that you can see the data that is being submitted and saved.
b. Click the Delete Cache icon in the Forms Manager toolbar if you have made any changes to the database columns.
c. If there is a Checkbox group in the form then you may need to use a Handle Arrays action to convert the array into a list for saving.
Bob
Thanks Bob
I have added a debugger and it shows the values from the selected checkboxes are in the array - you can see them here - I selected Day1 Day 3 and Day5:
But, I guess because these checkboxes were not created with the wizard, they are not included in the SQL in dbsave:
How would I go about editing the SQL that the wizard has generated for the Insert, or would I need to remove the dbsave and add a custom bit of PHP and MYSQL to do the data insert?
If so, can you point me to an example?
Many thanks
Mikki
I have added a debugger and it shows the values from the selected checkboxes are in the array - you can see them here - I selected Day1 Day 3 and Day5:
Array
(
[option] => com_chronoforms5
[chronoform] => add-bookings
[event] => submit
[first_name] => Tom
[last_name] => Jones
[no_of_children] => 0
[child1_firstname] => Jenny
[child1_lastname] => Jones
[child2_first_name] =>
[child2_last_name] =>
[Day1] => 19-12-2016
[Day3] => 21-12-2016
[Day5] => 23-12-2016
[button13] => Submit
[id] => 3
)
But, I guess because these checkboxes were not created with the wizard, they are not included in the SQL in dbsave:
[0] => INSERT INTO `josqp_chrono_bookings` (`first_name`, `last_name`, `no_of_children`, `child1_firstname`, `child1_lastname`, `child2_first_name`, `child2_last_name`, `user_id`, `uniq_id`, `created`) values ('Tom', 'Jones', '0', 'Jenny', 'Jones', '', '', '0', '1f1f09a0e3fb6661f24868a54e7a3e1bb1ae2fe4', '2016-11-27 16:11:05');
How would I go about editing the SQL that the wizard has generated for the Insert, or would I need to remove the dbsave and add a custom bit of PHP and MYSQL to do the data insert?
If so, can you point me to an example?
Many thanks
Mikki
Hi Mikki,
Do those columns exist in the database table? If they do, did you click the Delete Cache icon?
Bob
Do those columns exist in the database table? If they do, did you click the Delete Cache icon?
Bob
This topic is locked and no more replies can be posted.