You are here

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

Validate callback for rooms_pricing_update_form form.

1 string reference to 'rooms_pricing_update_form_validate'
rooms_pricing_update_form in modules/rooms_pricing/rooms_pricing.module
Form to manage the room units pricing.

File

modules/rooms_pricing/rooms_pricing.module, line 530
Manages pricing for Bookable Units and displaying dates on the jquery FullCalendar plugin.

Code

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

  // Make sure amount entered is numeric.
  if (!empty($form_state['values']['amount']) && !is_numeric($form_state['values']['amount'])) {
    form_set_error('amount', t('%name: you must enter a numeric value for the price.', array(
      '%name' => t('Amount'),
    )));
  }

  // Validate that a room is selected.
  _rooms_select_rooms_validation($form_state);
}