You are here

function _registration_validate_space_request in Entity Registration 7

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

Validation helper function to confirm the spaces requested are within limits.

1 string reference to '_registration_validate_space_request'
registration_form in includes/registration.forms.inc
Form callback: create or edit a registration.

File

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

Code

function _registration_validate_space_request($element, &$form_state, $form) {
  if (isset($form_state['input']['count']) && $form['#registration_settings']['settings']['maximum_spaces'] && $form_state['input']['count'] > $form['#registration_settings']['settings']['maximum_spaces']) {
    form_error($element, t('You may not register for more than @count spaces.', array(
      '@count' => $form['#registration_settings']['settings']['maximum_spaces'],
    )));
  }
}