Using hook_form_alter to change from text filter to checkboxes I'm using a custom module and hook_form_alter to change a Views Exposed Filter from a text field to checkboxes. When altering to a select list, the module works fine. However, when I change the form type to "checkbox", the filter renders as a single checked checkbox without a label. I thought I had solved it earlier by simply removing the #size line, but after reverting the code and trying to fix it that way again, it's no longer fixing it. Any idea what I need to change?

Working select list code:



function dropdown_bartab_form_views_exposed_form_alter(&amp;$form, &amp;$form_state) {
  $field_id = 'field_venue_bar_tab';

  // Only alter forms with the necessary field
  if (isset($form[$field_id .'_value'])) {

// Build a query to get all node ids having the specified field
$query = new EntityFieldQuery();
$results = $query-&gt;entityCondition('entity_type', 'node')
                  -&gt;fieldCondition($field_id, 'value', 'NULL', '!=')
                  -&gt;fieldOrderBy($field_id, 'value', 'ASC')                   
                  -&gt;execute();

// Attach the field values to the nodes
$nodes = $results['node'];
field_attach_load('node', $nodes, FIELD_LOAD_CURRENT, array('field_id' =&gt; $field_id));

// Add a default so the filter is optional
$options = array(
    '' =&gt; 'Any',
    '0' =&gt; 'Drinks',
    '1' =&gt; 'Food',
    );

// Alter the field
$form[$field_id .'_value']['#type'] = 'select';
$form[$field_id .'_value']['#options'] = $options;
$form[$field_id .'_value']['#size'] = 1;
  }
}
You probably want to use #type checkboxES (uppercase only for emphasis ;)), which is a list of checkboxes. checkbox is just a single checkbox that can either be checked or not, it can't have multiple options, so that property is ignored.