Using hook_form_alter(), how do I write a multi-select field?
I think you are searching for the #multiple attribute:
multiple
Used by: select
Description: Indicates whether the user may select more than one item.
Values: TRUE or FALSE
&lt;?php
return array(
  '#type' =&gt; 'select',
  '#title' =&gt; $title,
  '#default_value' =&gt; $value,
  '#options' =&gt; $options,
  '#description' =&gt; $description,
  '#multiple' =&gt; $multiple,
  '#size' =&gt; $multiple ? min(12, count($options)) : 0,
  '#weight' =&gt; -15,
);
?&gt;