Hi chekwan,
The first PHP Notice (which may not be a problem) is from a line in your Custom Code - you might want to take a look at that.
The remainder are because the Handle Arrays action is designed for use with simple single-level arrays from Checkbox groups and Multiple Drop-downs. It can't handle correctly the multi-level arrays created by a multiplier. If you add a Debugger action near the beginning of the form On Submit event you will see the data that is being submitted.
You want to keep the Handle Arrays for the two CheckBox groups - so add those names into the box in the action settings.
The best way of handling the Multiplier data is to use a second table for the repeating name mail and phone and save separate records there for each set of values linked to the main table by the record id.
Bob
Hi Bob
Based on the FAQ instruction:
1- Create table for main information
2- When view the table structure, uncheck for the multiplier content
3- Save
4- Create another table for additional multiplier information.
5- Check the multiplier and uncheck others (except cf_id)
6- Link both table using Multi Save.
It is correct.?
HI chekwan,
Yes, apart from step 5 - what you need to do there is add a custom code action that will add the new cf_id value to each of the entries in the multiplier array.
Bob
Not to hijack what may now be an old thread, but would it be possible to provide an example of what the model's array should look like? I'm just having trouble visualizing it atm. Also, if I have my multiplier field something like AdditionalNumbers_##_number, should I be keeping it as that in the table structure, or should I be renaming it to something like AdditionalNumbers?
Hi Bob. I looked at that first. I guess my brain is just failing at connecting how the array needs to be structured to go into the db, and the multiplier example/demo you guys have for us doesn't include saving to the db.
For example, if my field is named AdditionalNumbers_##_number, i don't know if i need a repeater to construct the array properly to go in the db, or is it just $this->data["AdditionalNumbers"][]["number"] and the multi save will just save them all automatically. I know we need a cf_id, but didn't know if i need to manually create a new array to be used with saving via model along the lines of:
$Data2 = array();
$Data2["cf_id"] = $this->data["id"];
$Data2["AdditionalNumbers"] = $this->data["AdditionalNumbers"];
I'm assuming even though i name my field $AdditionalNumbers_##_number, cf automatically converts the name into the multi dimensional array.
Sorry I'm being so dense. The worst part is that i know I've set this up correctly in the past.
Slightly related, if i have two multiplier fields (numbers and fax_numbers), it's fine to use the same replacer (##)? There can be different number of numbers and fax_numbers, so i can't put both fields in the same multiplier container.
Hi rtobias,
The example in the FAQ will save into a database table using the Multiple option to save the multiplier elements. It's hard to be more specific as I can't work out form your posts what you are trying to do or how you want to save the repeater data.
I'm assuming even though i name my field $AdditionalNumbers_##_number, cf automatically converts the name into the multi dimensional array. No it doesn't - you need to use array names like those in the FAQ.
if i have two multiplier fields (numbers and fax_numbers), it's fine to use the same replacer (##)?I've never tried but I would use different keys to avoid any doubt e.g. #a# and #b#
Bob