I put in my
hook_form_alter function where I assign
'#type'= 'hidden' to
But I want to show it when in the select list "Provincia" of the same form I select the option "Bergamo".
I suppose to solve with
jQuery, but in the inspector of the page I can't
#edit-field-bergamo" ID, only the name.
"jQuery ('input[name="field_bergamo"]').show()", it doesn't work.
If I don't assign
['#type'] = 'hidden' to "field_bergamo" in
hook_form_alter I can see the
"#edit-field-bergamo" in the inspector and
the jQuery commands
.show() .hide() work correctly.
Why if I assign
['#type'] = 'hidden', the field doesn't have an ID and
doesn't react to my jQuery commands?
P.S. I can't use Conditional Field because the select list "provincia" is inside a field type "Postal address" and is not singularly accessible.
And I don't like to install a module if not strictly necessary!