You are here

function bat_unit_edit_form_validate in Booking and Availability Management Tools for Drupal 7

Form API validate callback for the booking unit form.

1 string reference to 'bat_unit_edit_form_validate'
bat_unit_edit_form in modules/bat_unit/bat_unit.admin.inc
Form callback: create or edit a unit.

File

modules/bat_unit/bat_unit.admin.inc, line 328
BatUnit editing UI.

Code

function bat_unit_edit_form_validate(&$form, &$form_state) {

  // Notify field widgets to validate their data.
  entity_form_field_validate('bat_unit', $form, $form_state);
  if (!empty($form_state['values']['multiple']) && (!is_numeric($form_state['values']['multiple']) || $form_state['values']['multiple'] < 1)) {
    form_set_error('Multiple units error', t('%name: you must enter at least 1 as the number of multiple units.', array(
      '%name' => t('Multiple units'),
    )));
  }
}