I have a form with the id of node_contact_edit_form. On this form it has an image field that has the default Drupal choose file button. I would like to disable/hide the button and only allow the users to pick the images from a folder I have on the server. I have tried hooks like form_node_contact_edit_form_alter but can't figure out how to target the button only. Anyone have some ideas?
I need fields with widget select to make some of them read-only.
I tried both with
$form['field_localita_missione']['widget']['#disabled'] = TRUE;
that with
$form['field_localita_missione']['#attributes']['readonly'] = TRUE;
The former works but does not save the data, while the latter does not work
I'm a site webmaster who knows just enough Drupal to be able to (sometimes) add a new feature that I really need to be able to become more efficient at my job. I wound up creating a couple new global fields for Drupal 7 views, and anticipate creating more. These fields might be useful to others, so I'd like to contribute them to the Drupal community; then again, if the way I created them doesn't fit well with Drupal, then they might not be a good fit for contribution (yet).