I have model create form (to create a new user) and I would like to make one of the form elements appear only when a certain item is selected in a dropdown select menu.
I think jquery is the best way probably but I’ve not found much on how to create jquery functions and including them using the yii framework.
This one seems to stop after a very very short introduction on how to get ‘hello’ alert working:
Thats really great, its works nicely, but i have ‘bodged’ a default hidden by adding style=“display:none” to the DIV thats being toggled…
Also, if i then go back into the form, the div is hidden (obviously) to show it again to edit the value of the form element, I have to ‘change’ the drop down to ‘toggle’ the hidden div…
how can I set it to show the field if its been used, uhm, this sort of thing easier to explain in code if ( #id-of-dropdown == ‘xyz’) { show(); }