I added a field to my commerce checkout form:
mymodule_form_alter(..) {
...
if($form_id ="commerce_checkout_form") {
$form['thisfield'] = array(
'#type' => 'fieldset',
'#title' => t('Contact settings'),
'#weight' => 5,
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['thisfield']['checkbox']= array (
'#type' => 'checkboxes',
'#options' => drupal_map_assoc(array(t('SAT'), t('ACT'))),
'#title' => t('What standardized tests did you take?'),
'#required' => TRUE,
),
....
}
}
Now the form may not go to the next step if the checkbox is not checked. If i press the sumbit button now, i go to the next step with the error displayed that the field is requierd. So the error message appears, but the form still continues to the next step.
Now i don't really know how to keep the commerce form on the same step if the checkbox is not checked.