You are here

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

AJAX callback for the children ages form element.

Triggers automatically the re-assign submit button and help the user to don't forget re-assign price.

See also

rooms_booking_edit_form()

1 string reference to 'rooms_booking_childrens_age_ajax_callback'
rooms_booking_edit_form in modules/rooms_booking/rooms_booking.admin.inc
Form callback: create or edit a booking.

File

modules/rooms_booking/rooms_booking.admin.inc, line 954
Rooms editing UI.

Code

function rooms_booking_childrens_age_ajax_callback($form, &$form_state) {
  if (isset($form_state['values']['unit_id'])) {
    $commands[] = ajax_command_invoke('#edit-get-availability', 'trigger', array(
      'mousedown',
    ));
    print ajax_render($commands);
  }
  exit;
}