How to set the default for checkboxes element I'm trying to set the default of a checkboxes list in the form_alter_hook.

$form['average'] = array(
  '#type' =&gt; 'checkboxes',
  '#options' =&gt; array('a','b','c'),
  '#default_value' =&gt; array('a'),
  '#title' =&gt; t('The average vote is more than'),
  );


I'm expecting 'a' to be checked, that it never seems to happen. I'm using better exposed filters, but I doubt that would make a difference?
Simplistically, the issue is that the default value uses the array key, not the array value.  So, there are two ways you can change this to make it work.

One:

$form['average'] = array(
  '#type' =&gt; 'checkboxes',
  '#options' =&gt; array('a' =&gt; 'a','b' =&gt; 'b', 'c' =&gt; 'c'),
  '#default_value' =&gt; array('a'),
  '#title' =&gt; t('The average vote is more than'),
);


or

$form['average'] = array(
  '#type' =&gt; 'checkboxes',
  '#options' =&gt; array('a','b','c'),
  '#default_value' =&gt; array(0),
  '#title' =&gt; t('The average vote is more than'),
);