function _flexslider_validate_positive_integer in Flex Slider 7.2
Same name and namespace in other branches
- 7 flexslider.admin.inc \_flexslider_validate_positive_integer()
Validate a form element that should have an integer value.
1 string reference to '_flexslider_validate_positive_integer'
- flexslider_option_elements in ./
flexslider.admin.inc - Defines the form elements used to edit the FlexSlider library options
File
- ./
flexslider.admin.inc, line 428 - Administrative page callbacks for the flexslider module.
Code
function _flexslider_validate_positive_integer($element, &$form_state) {
$value = $element['#value'];
if ($value !== '' && (!is_numeric($value) || intval($value) != $value || $value < 0)) {
form_error($element, t('%name must be a positive integer.', array(
'%name' => $element['#title'],
)));
}
}