Field with '#type' = 'hidden' in hook form alter doesn't show #id in the source and it's not possible to show it with jQuery I put in my template.php an hook_form_alter function where I assign '#type'= 'hidden' to "field_bergamo".

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 
see the 
"#edit-field-bergamo" ID, only the name.

I tried "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?

Any solution?

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!
You've converted the element to a hidden input type.

Hidden inputs cannot be rendered, as the name suggests (they're hidden by their nature). So trying to use javascript to "show" them will never have any effect - there's nothing to show.

Add that to the fact that a changed hidden input element will invoke a validation failure for a tainted form, and it should be easy to see why the Drupal devs didn't bother to add an HTML ID to the element. Trying to access it with CSS/JS makes very little sense most of the time.

If you just meant to hide the original input, not convert it to a different input type, just use CSS to hide/show it as normal.