data['MODEL_ID']) into the on submit custom code (which is just after a DB Save)and it revealed the problem, the part that show the multi select looks like this:[my_multi_select_field[b][[/b]] => 6 (I bolded red the redundant character)instead of showing as an array with multiple cells of all selected values.it might be a regex that should be changed to be greedy or use the whole string of the field name before stripping the MODEL_ID[(.*)]Hope i got it right and described it clear.Thanks"> DB Record Loader + model id enabled + multi select problem - Forums

Forums

DB Record Loader + model id enabled + multi select problem

weissmag 22 Jun, 2011
Hi,

I have a form which has a multi select list box that is handled by custom code.

in the DB Record loader it is written that if you change "Load Under Model ID" to Yes you should enclose your fields names in the html like this: name='MODEL_ID[field_name]'

so i did, including the multi select field which results: name="MODEL_ID[my_multi_select_field[]]"

then it ruins my custom code in the on submit which was working perfectly, so i added a print_r($form->data['MODEL_ID']) into the on submit custom code (which is just after a DB Save)

and it revealed the problem, the part that show the multi select looks like this:
[my_multi_select_field[b][[/b]] => 6
(I bolded red the redundant character)

instead of showing as an array with multiple cells of all selected values.

it might be a regex that should be changed to be greedy or use the whole string of the field name before stripping the MODEL_ID[(.*)]

Hope i got it right and described it clear.

Thanks
GreyHead 23 Jun, 2011
Hi weissmag,

I haven't tried the Model ID code yet but my guess is that the correct syntax is name="MODEL_ID[my_multi_select_field][]" This fits with the normal PHP array coding and would explain the error you get.

Bob

PS From your PM. Just FYI - ChronoForms is Max's product, not mine, I help out with some techical support here.
weissmag 24 Jun, 2011
Thanks Bob

It works.
This topic is locked and no more replies can be posted.