function element_validate_integer_positive

Form element validation handler for integer elements that must be positive.

Related topics

1 call to element_validate_integer_positive()
_element_validate_integer_positive in drupal/modules/field/field.module
DEPRECATED: Helper form element validator: integer > 0.
9 string references to 'element_validate_integer_positive'
hook_field_formatter_settings_form in drupal/modules/field_ui/field_ui.api.php
Specify the form elements for a formatter's settings.
hook_field_settings_form in drupal/modules/field_ui/field_ui.api.php
Add settings to a field settings form.
hook_field_widget_settings_form in drupal/modules/field_ui/field_ui.api.php
Add settings to a widget settings form.
search_admin_settings in drupal/modules/search/
Menu callback: displays the search module settings page.
text_field_formatter_settings_form in drupal/modules/field/modules/text/text.module
Implements hook_field_formatter_settings_form().

... See full list


drupal/includes/, line 4386
Functions for form and batch generation and processing.


function 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'],