function form_test_checkboxes_zero($form, &$form_state, $json = TRUE) {
$form['checkbox_off'] = array(
'#type' => 'checkboxes',
'#options' => array(
'foo',
'bar',
'baz',
),
);
$form['checkbox_zero_default'] = array(
'#type' => 'checkboxes',
'#options' => array(
'foo',
'bar',
'baz',
),
'#default_value' => array(
0,
),
);
$form['checkbox_string_zero_default'] = array(
'#type' => 'checkboxes',
'#options' => array(
'foo',
'bar',
'baz',
),
'#default_value' => array(
'0',
),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Save',
);
if ($json) {
$form['#submit'][] = '_form_test_submit_values_json';
}
else {
$form['#submit'][] = '_form_test_checkboxes_zero_no_redirect';
}
return $form;
}