function _field_hidden_element_validate_integer_positive in Field Hidden 7
Validator copied from core form.inc.
Somehow the original function isn't accessible here.
Parameters
array $element:
array &$form_state:
Return value
void
1 string reference to '_field_hidden_element_validate_integer_positive'
- field_hidden_field_settings_form in ./
field_hidden.module - For editing settings that apply to all instances of the field (e.g. 'some_hidden' across all content types).
File
- ./
field_hidden.module, line 316 - Drupal Field Hidden module
Code
function _field_hidden_element_validate_integer_positive($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'],
)));
}
}