Where is Array fields (available in general/advanced tab in chronoconnectivity v4) in chronoconnectivity V5 to indicate the fields with concateneted array values, in order to extract these values to an array, when they the data is loaded? This is necessary to display the checkbox groups in the edit form.
Forums
chronoconnectivity V5 How to handle arrays
Hi tvd,
Just add the action above the HTML action in the "on load" event of your edit form, it should work fine there too!
Regards,
Max
Just add the action above the HTML action in the "on load" event of your edit form, it should work fine there too!
Regards,
Max
Sorry, I was wrong!🙂
You need a "Custom code" action before the "html" action in order to extract the values, since CCv5 doesn't have this feature.
Just use 1 line of PHP code per field:
Regards,
Max
You need a "Custom code" action before the "html" action in order to extract the values, since CCv5 doesn't have this feature.
Just use 1 line of PHP code per field:
<?php
$form->data["field"] = explode(",", $form->data["field"]);
Regards,
Max
HI Max,
My fieldname is: muziekinstrument and the model defined in chroconnectivity is: gebruiker
I tried:
and
Both actions results in an empty checkbox group
Theo
My fieldname is: muziekinstrument and the model defined in chroconnectivity is: gebruiker
I tried:
<?php
$form->data["gebruiker[muziekinstrument]"] = explode(",", $form->data["gebruiker[muziekinstrument]"]);
?>
and
<?php
$form->data["muziekinstrument"] = explode(",", $form->data["muziekinstrument"]);
?>
Both actions results in an empty checkbox group
Theo
Hi Theo,
It should be:
Regards,
Max
It should be:
<?php
$form->data["muziekinstrument"] = explode(",", $form->data["gebruiker"]["muziekinstrument"]);
?>
Regards,
Max
I am having a similar problem with an edit form I am trying to create. I have a field called 'mCities' that is tied to a multiple selection drop down. When there is only 1 city selected, the edit form looks fine. When there are multiple cities in the database, none are selected when it populates the edit form. All the other fields are fine. I have tried the 'handle arrays' function and also tried the above suggestion using:
<?php
$form->data["cmodels"]["mCities[]"] = explode(",", $form->data["cmodels"]["mCities"]);
?>
The debug shows:
[cmodels] => Array
(
[mID] => 7
[mCities] => Atlanta,Los Angeles,NYC
I am at a total loss. Any suggestions?
The page in question is at: http://adonis.carbendata.com/index.php?option=com_chronoconnectivity5&cont=lists&act=index&ccname=ModelInfoEdit
Thanks in advance for any help!🙂
<?php
$form->data["cmodels"]["mCities[]"] = explode(",", $form->data["cmodels"]["mCities"]);
?>
The debug shows:
[cmodels] => Array
(
[mID] => 7
[mCities] => Atlanta,Los Angeles,NYC
I am at a total loss. Any suggestions?
The page in question is at: http://adonis.carbendata.com/index.php?option=com_chronoconnectivity5&cont=lists&act=index&ccname=ModelInfoEdit
Thanks in advance for any help!🙂
This should be the code:
Regards,
Max
<?php
$form->data["cmodels"]["mCities"] = explode(",", $form->data["cmodels"]["mCities"]);
Regards,
Max
This topic is locked and no more replies can be posted.