How to set readonly or locked a select webform field? I want to lock a prefilled select webform field but no option is provided by the UI.So I think to do that programmatically.

Actually I do in a hook_form_alter:

$form['submitted']['discipline_du_poste']['#attributes'] = array('readonly' =&gt; 'readonly');


and this doesn't effect...what's wrong ?
Not sure how much this is a helpful answer, but was looking for a recipe to do this and found this example using a simple little hook_form_alter (which happens to be for civicrm components in a webform but think the principle is what counts)

$form['submitted']['civicrm_2_contact_1_fieldset_fieldset']['civicrm_2_contact_1_relationship_relationship_type_id']['#disabled'] = TRUE;