Using states in Drupal 7 form to provide 'select all' functionality
I don't think the "checked" property works with the "checkboxes" form control (or if I does I know how to use it!)

As a work around use the checkbox type instead:

$form['report_group']['selectall'] = array(
  '#title' =&gt; 'Check All',
  '#type' =&gt; 'checkbox',
  '#default_value' =&gt; 0,
);

$boxes = array(1 =&gt; 'one', 2 =&gt; 'two', 3 =&gt; 'three', 4 =&gt; 'four', 5 =&gt; 'five');

foreach($boxes as $key =&gt; $val) {

  $form['report_group']['box_'.$key] = array(
    '#type' =&gt; 'checkbox',
    '#title' =&gt; $val,
    '#return_value' =&gt; $key,
    '#states' =&gt; array(
      'checked' =&gt; array(
        ':input[name="selectall"]' =&gt; array('checked' =&gt; TRUE),
      ),
    ),
  );
}


Your selector was also wrong. This is a jQuery selector so I find it easiest to use firebug to figure out what it should be and test if it's working.