Commerce checkout, check if checkbox is checked I added a field to my commerce checkout form:

mymodule_form_alter(..) {
 ...
 if($form_id ="commerce_checkout_form") {
 $form['thisfield'] = array(
  '#type' =&gt; 'fieldset', 
  '#title' =&gt; t('Contact settings'), 
  '#weight' =&gt; 5, 
  '#collapsible' =&gt; TRUE, 
  '#collapsed' =&gt; FALSE,
 );

 $form['thisfield']['checkbox']= array (
   '#type' =&gt; 'checkboxes',
   '#options' =&gt; drupal_map_assoc(array(t('SAT'), t('ACT'))),
   '#title' =&gt; t('What standardized tests did you take?'),
   '#required' =&gt; 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.
You shouldn't add the field directly to the checkout form, but rather create a new checkout pane and add the field to that.

e.g:

/**
 * Implements hook_commerce_checkout_pane_info
 */
function MODULE_commerce_checkout_pane_info() {
  $checkout_panes = array();

  $checkout_panes['contact_settings'] = array(
    'title' =&gt; t('Contact settings'), 
    'file' =&gt; 'includes/commerce_checkout.checkout_pane.inc', 
    'base' =&gt; 'MODULE_checkout_contact_settings_pane', 
    'page' =&gt; 'checkout', 
    'callbacks' =&gt; array('checkout_form_validate' =&gt; 'MODULE_checkout_contact_settings_pane_validate')
    'fieldset' =&gt; TRUE,
  );

  return $checkout_panes;
}


Put your form builder in includes/commerce_checkout.checkout_pane.inc > MODULE_checkout_contact_settings_pane

You can then use the Commerce API to validate your checkout form in

/**
 * Checkout pane validation for contact_settings
 */
function MODULE_checkout_contact_settings_pane_validate(&amp;$form, &amp;$form_state, $checkout_pane, $order) {

  // Do some validation tests here... omitted for brevity.
  if (empty($form_state['values']['thisfield'])) {
    drupal_set_message(t('Some validation error message'), 'warning');
    return FALSE;
  }

  return TRUE;

}


More info: hook_commerce_checkout_pane_info