Skip to content

integer rule (v1)

Require a valid integer.

Since
1.0.10
Signature
integer(input)
Options
0

Usage

integer usage
bootstrapValidate('#input', 'integer:Please fill out this input field!')

Options

This rule only needs an error message after the rule name, for example integer:Please fill out this input field!.

Live Example

Checking...

Source

integer source
/**
* @since 1.0.10
* @error Please fill out this input field!
* @description Require a valid integer.
*/
export default function integer(input: RuleInput) {
return isInteger(Number(input.value));
}