Disable an option for the select form field How do I disable an option in the select form field?

$form['feed'] = array(
  '#type' =&gt; 'select', 
  '#title' =&gt; t('Display of XML feed items'), 
  '#options' =&gt; array(
    'title' =&gt; t('Titles only'), 
    'teaser' =&gt; t('Titles plus teaser'), 
    'fulltext' =&gt; t('Full text'),
  ),
  '#description' =&gt; t('Global setting for the length of XML feed items that are output by default.'),
);


How can I disable, for example, the "Title only" option?
Disabling an option may be tricky to achieve (Using form_alter to disable ONE option of a select field) so I'll recommend you to look at optgroups as an alternative. The Drupal form API documentation doesn't explain it but the API allows nested array for the options, have a look at form_select_options() and the &lt;optgroup&gt; part.
You can write this code:

$form['feed'] = array(
    '#type' =&gt; 'select', 
    '#title' =&gt; t('Display of XML feed items'), 
    '#options' =&gt; array(
        'Titles only' =&gt; array(, 
          'teaser' =&gt; t('Titles plus teaser'), 
          'fulltext' =&gt; t('Full text'),
        ),
        'Titles only 2' =&gt; array(, 
          'teaser2' =&gt; t('Titles plus teaser 2'), 
          'fulltext2' =&gt; t('Full text 2'),
        ),
    ),
    '#description' =&gt; t('Global setting for the length of XML feed items that are output by default.'),
);


Have a look at Drupal 6 forms and optgroup arrays.

Edit: to clarify this is an alternative and not a direct answer.