Good morning
I tried to create a Dynamic dropdown in my form (I got inspiration from the demo).
My form has 4 fields inserted into an "area repeater".
the name of the first is: Model[{var: area_repeater6.key}][description_materiale]this is an autocomplete dropdown, which works thanks to your help:
http://www.chronoengine.com/forums/posts/t106946/where-conditions-for-a-dropdown-autocomplete-inside-a-repeater-area
the second field is always a dropdown called: Model[{var: area_repeater6.key}][um]
my goal is to change the value of Model[{var: area_repeater6.key}][um] when changing the value of Model[{var: area_repeater6.key}][description_materiale] dynamically
for now I did this:
On the "design" area I went to the Model events tab of Model[{var: area_repeater6.key}] [description_materiale] and filled in as follows:
on = change
actions = reload
element (s) identifier = Model [{var: area_repeater6.key}] [um]
in the dropdown Model[{var: area_repeater6.key}] [um]
in general tab:
Options= {var: umvalue}
in the Advanced tab
reload event= um_read

in the "setup" area, I created a new event called um_read. inside I put a php code called umvalue with this code:
$descrizione=$this->data("Model.[n]")[0]["descrizione_materiale"];
$db = \JFactory::getDBO();
$sql = "
SELECT um
FROM SA_schede_materiale
WHERE descrizione_materiale = '".$descrizione."'";
$db->setQuery( $sql );
$misura= $db->loadResult();
return $misura;
and after the php code I inserted a "custom code" with this: {view: field_select26}
(field_select26 refers to the dropdown Model [{var: area_repeater6.key}] [um])

in this way, the autocompletion works only for the first Model[{var: area_repeater6.key}][um] of the area repeater,
when I add other fields by pressing "add" the UM value of the following ones is always the same as the first one.
How can I make the autocompletion work for all the "UM" fields of my area_repeater?
thank you so much
I tried to create a Dynamic dropdown in my form (I got inspiration from the demo).
My form has 4 fields inserted into an "area repeater".
the name of the first is: Model[{var: area_repeater6.key}][description_materiale]this is an autocomplete dropdown, which works thanks to your help:
http://www.chronoengine.com/forums/posts/t106946/where-conditions-for-a-dropdown-autocomplete-inside-a-repeater-area
the second field is always a dropdown called: Model[{var: area_repeater6.key}][um]
my goal is to change the value of Model[{var: area_repeater6.key}][um] when changing the value of Model[{var: area_repeater6.key}][description_materiale] dynamically
for now I did this:
On the "design" area I went to the Model events tab of Model[{var: area_repeater6.key}] [description_materiale] and filled in as follows:
on = change
actions = reload
element (s) identifier = Model [{var: area_repeater6.key}] [um]
in the dropdown Model[{var: area_repeater6.key}] [um]
in general tab:
Options= {var: umvalue}
in the Advanced tab
reload event= um_read
in the "setup" area, I created a new event called um_read. inside I put a php code called umvalue with this code:
$descrizione=$this->data("Model.[n]")[0]["descrizione_materiale"];
$db = \JFactory::getDBO();
$sql = "
SELECT um
FROM SA_schede_materiale
WHERE descrizione_materiale = '".$descrizione."'";
$db->setQuery( $sql );
$misura= $db->loadResult();
return $misura;
and after the php code I inserted a "custom code" with this: {view: field_select26}
(field_select26 refers to the dropdown Model [{var: area_repeater6.key}] [um])
in this way, the autocompletion works only for the first Model[{var: area_repeater6.key}][um] of the area repeater,
when I add other fields by pressing "add" the UM value of the following ones is always the same as the first one.
How can I make the autocompletion work for all the "UM" fields of my area_repeater?
thank you so much