You are here

function rules_ui_element_integer_list_validate in Rules 7.2

FAPI callback to validate a list of integers.

1 string reference to 'rules_ui_element_integer_list_validate'
RulesDataUIListInteger::inputForm in ui/ui.data.inc
Implements RulesDataDirectInputFormInterface::inputForm().

File

ui/ui.forms.inc, line 880
Rules User Interface forms.

Code

function rules_ui_element_integer_list_validate($element, &$form_state) {
  foreach ($element['#value'] as $value) {
    if ($value !== '' && (!is_numeric($value) || intval($value) != $value)) {
      form_error($element, t('Each value must be an integer.'));
    }
  }
}