PHP Form Plugin and Repeat Groups

joshurb

New Member
Hello,

I am trying to write/use a php form plugin to update a tag field on load of that form. When I print_r the form data of an existing record, The tags appear to be stored in an array. I created an array of tags( a few random ones to test it out) and tried using $formModel->updateFormData('fab_tag_demo___tag', $tags, true); to try and preload the data but it does not seem to be working. $tags is an array variable. On the php form plugin page in the wiki, it says the second param should be a string(I figured I would give the array a try but no dice). I'm stumped. Is what I am trying to attempt possible?

Thanks
Josh
 
Putting these lines of code at the start of your php script might help identify what you need to send as $tags. This will tell you if updateFormData() is expecting a string or an array - i.e. what variable type and what format.

PHP:
$vartype = gettype($formModel->formData['fab_tag_demo___tag']);
$temp = $formModel->formData['fab_tag_demo___tag'];
echo "vartype is ".$vartype." - value is ".var_dump($temp);
exit;
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top