You are here

function rooms_booking_children_discount_validate in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Validate callback for rooms_booking_children_discount form.

File

modules/rooms_booking/rooms_booking.module, line 223
Manage Bookings - Bookings are tied to a customer profile and possible a Unit ID and Order ID.

Code

function rooms_booking_children_discount_validate($form, &$form_state) {
  foreach ($form_state['values']['option'] as $key => $value) {
    if ($value['start'] != '' || $value['end'] != '' || $value['discount'] != '') {
      if ($value['start'] > $value['end']) {
        form_set_error('option][' . $key . '][start', t('End age must be greater than start age.'));
      }
    }
  }
}