update room number field to be an integer

This commit is contained in:
2016-06-28 13:12:55 +10:00
parent 1aa9f6cfbe
commit d5d45512c6
4 changed files with 62 additions and 2 deletions

View File

@@ -425,6 +425,18 @@ function booking_rooms_definition_form($node, &$form_state, $create, $room_id =
}
}
/**
* Validate the form for adding room definitions
*/
function booking_rooms_definition_form_validate($form, $form_state) {
//make sure room number is numerical
$values = $form_state['input'];
if (! is_numeric($values['booking_room_number'])) {
form_set_error('booking_room_number', t('Room number must be numeric. If you need to use a more descriptive label, please use the room label field.'));
}
}
/**
* Process the form for adding room definitions
*/