I created a multi-page-form. On page 2 I created a multiplier-field with multicontent. I can fill in the form and the multiplier works fine. (I used the demoforms for both parts- thanks)
I use email and I want all data to be saved to a database. The data of the first page is saved but how can I save the multicontent? What is the syntax and where do I have to use it?
Thanks for the quick answer. I 'll studie the faq later today but I think this is what I was looking for. (I had no clue how to search for it, sorry)
The records in the first table save. [id] is the field I need.
Do I have to add a text field to the multiplier content? What is the syntax to use the [id] and in which field do I have to add that?
I must have changed something somewhere. The debuginfo doesn't show the multi-data anymore. I tried everything but I can't find the problem.
What can be the reason that the debuginfo says:
[shirt] => Array,Array
instead of
[shirt] => Array
(
[1] => Array
(
[style] => bjhk
[size] => kjiu
)
[2] => Array
(
[style] => fkjfgs
[size] => iurt
)
When I don't use the handle array event, the content of the array is visible.
Hi Pokomon,
The Handle Arrays action converts an array into a string (and not the reverse). Do you need it here?
Bob
I couldn't get the form working and saving. Multipage, multifield, multisave. I don't understand where and how I get the Id into the new array. Is there a demoform that saves data into two different tables.
Hi pokomon ,
You get the id into the new array using a Custom Code action with code like the example I posted earlier.
Bob
I tried but couldn't get it working.
Hi pokomon,
What code did you use exactly?
What do you see in the Debugger output?
Bob
I bumped into different problems so I just started from scratch.
The first problem: multipage
On the demomultipage I put some fields on every page and save it to a database. This doesn't update but create a new record on every page (save).
The second problem: multifield - connection to the id or cf_id
I added a multifield in a container multiplier/container multiplier content on the second page. I followed the steps for the container multiplier.
I also have a hidden field cf_id on every page
Debug info after page 1
Array
(
[option] => com_chronoforms5
[chronoform] => demo-multipageTest
[event] => page2
[text5] => fgg
[cf_id] => 43
[id] =>
[button6] => Volgende1
)
Debug info after page 2
Array
(
[option] => com_chronoforms5
[chronoform] => demo-multipageTest
[event] => page3
[text5] => fgg
[cf_id] =>
[id] =>
[button6] => Volgende1
[dropdown7] => 0
[multi] => Array
(
[1] => qfdqfar
)
[button8] => Volgende2
)
I don't understand where I need to put the custom code. In the designer tab (on the first page or second page) or in the setup page event of the second page? This is the code I used. I changed id in cf_id. This is the id_field in the first debuginfo-array.
<?php
foreach ( $form->data['multi'] as $k => $v ) {
$form->data['multi'][$k]['id'] = $form->data['cf_id'];
}
?>