You are here

function registration_state_overview_form_validate in Entity Registration 8

Same name and namespace in other branches
  1. 8.2 includes/registration.forms.inc \registration_state_overview_form_validate()
  2. 7.2 includes/registration.forms.inc \registration_state_overview_form_validate()
  3. 7 includes/registration.forms.inc \registration_state_overview_form_validate()

Validation handler for the registration states form.

File

includes/registration.forms.inc, line 977
Form definitions and callbacks for Registration.

Code

function registration_state_overview_form_validate($form, &$form_state) {

  // Ensure each state is only "active" or "pending" – not both.
  foreach ($form_state['input']['state'] as $state) {
    if ($state['active'] && $state['held']) {
      form_set_error('state', 'A state can only be "active" or "pending" – not both. Update the "' . $state['label'] . '" state to resolve this warning.');
    }
  }
}