in chronoforms5 I had some form with text fields that were updated based on the choice made in a dynamic dropdown.
In chronoforms6 I have difficulties.
This is the procedure that I have implemented and that does not work:
I have a data4 read in setup that I recall in the "option" section of the dropdown with {var: read_data4}.
OK so far it works.Then in relation to the chosen value I want to update the text field with another value of that array.
So I inserted the following code in a new read to the "Filter settings" section:
So in the "on found" event I entered a php code of this type:
Does anyone have any ideas? Thank you
In chronoforms6 I have difficulties.
This is the procedure that I have implemented and that does not work:
I have a data4 read in setup that I recall in the "option" section of the dropdown with {var: read_data4}.
OK so far it works.Then in relation to the chosen value I want to update the text field with another value of that array.
So I inserted the following code in a new read to the "Filter settings" section:
<?phpwhich is taken as data7.
return array('cognome_lavoratore' => $form->data['cognome_lavoratore']);
?>
So in the "on found" event I entered a php code of this type:
<?phpAll this referred to as reload to the text field that must change.
$options = array();
foreach ($form->data['data7'] as $d) {
$options[$d['id']] = $d['cognome_lavoratori'];
}
echo $options[$d['id']];
?>
Does anyone have any ideas? Thank you