function rules_ui_element_integer_list_validate

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 882

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.'));
        }
    }
}