Forums

problem with checkbox and model id

RobP 28 Sep, 2013
I have a problem with checkboxes on my form.

In the On submit I have a Handle Arrays action before the DB save.
On a test form without a model id it works ok, but on a form with model id's not.

The error message is "Tablechronoforms_data_checkbox::bind(*NULL*)
Any idea's?

Rob
RobP 28 Sep, 2013
I found a solution.
Instead of the Handle Arrays action I use a Custom Code with:

<?php
$form->data['klachten']['behandeld'] = implode(',',$form->data['behandeld']);
?>

That puts the array values from "behandeld"( without model id) as a string in $form->data['klachten']['behandeld'].

Now it can be saved it in the table.

Rob
GreyHead 28 Sep, 2013
Hi Rob,

That looks good, I don't think that the Handle Arrays action is sophisticated enough to recognise and handle the nested arrays you get with Model Ids.

Bob
RobP 28 Sep, 2013
I'm starting to appreciate php. it has some very handy functions!

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