Forums

Array Handle Error

zulpaedi 09 Mar, 2012
Dear All,

Appreciate if there is idea to solve my problem when handling an array to display the data Onload event DB Record Loader I have found error "Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\AppServ\www\instrument\components\com_chronoforms\libraries\includes\data_republish.php on line 150".
I have successfully save the data (array) multiple select box into field of database but when I try to display the data in my Change/ Edit form I have got above error. Please some one help me how to solve this issue. I use the Chronoform V.4 RC 1.9

Thanks.
Zul
GreyHead 09 Mar, 2012
Hi Zul,

Please upgrade to the current release, I'm pretty sure that this was fixed a while ago. If not there is a link to a fix in one of the older CFv4 bug list posts.

Bob
zulpaedi 10 Mar, 2012
Hi GreyHead,

I have updated to the latest version of Chronoforms V4. RC 3.21, but it was not solved the problem. Here is my need : I want to load some data into form using DB Record Loader at On Load event. One of my select box will filled in by array data with delimeter " , " but it was generate an error just like my previous post. Actually it was not big deal but if I can solve the problem it will be better at least I can disable the error/ warning message. Do you have any idea Grey?

Thank you very much for your kind help.

Regards,
Zul
GreyHead 11 Mar, 2012
Hi Zul,

Hmm I still think the ChronoForms 'ought' to handle this but you can try a 'reverse array handler'. Add a Custom Code action in the ON Load event and drag it up before the Show HTML action. Put this code into the box:
<?php
$form->data['input_name'] = explode(',', $form->data['column_name']);
?>

Bob
zulpaedi 12 Mar, 2012
Hi GreyHead,

I have follow your guidance but it still not solve the problem, the error message still occure. Could you please take a look with my form back up attached? I don't know what actually wrong in form. The multiple select box should be selected (higlighted on selected item) base on data base data that retrieved on load event.

Thanks,
Zul
This topic is locked and no more replies can be posted.