Editor : show or hide form elements when selecting values from dropdown select control
Editor : show or hide form elements when selecting values from dropdown select control

Hello,
1./ Show / hide controls when selecting value in select box control
I would like to know if it is possible to show / hide some controls when creating or modifying a line with Editor control like it is done with dependent field but with a select control filled from SQL select.
In fact, I have a select box control filled from another (join) and when I select a value in this control; depending of the selected value; I want to show or hide some controls.
So what is the way to bind event on the select box control in order to do that?
2./ have extra data on select box control
And also, is it possible the have a third data associated to the select.
For example, the select control can only have a key and a associated value.
Field::inst('t1.key')
->options(Options::inst()
->table('t2')
->value('key')
->label('value')
)
->validator('Validate::dbValues')
But in my case, I need to have a third value from my join table.
This third column has to be used to determine the controls I have to show / hide in the html form
It could be add to an html 5 data attribute like that:
<option value="mykey" data-attr="myThirdValue">My value</option>
I hope that my question is not too confused (sorry for my bad english)
Thanks in advance and have a nice day.