between validator

Check if the input value is between (strictly or not) two given numbers

Options

Using with form field

* presents a required option. The HTML attributes are used to set the validator options via the Declarative plugin

Name HTML attribute Type Description
inclusive data-fv-between___inclusive Boolean Can be true or false. If true, the input value must be in the range strictly
max* data-fv-between___max or max Float The upper value in the range
message data-fv-between___message String The error message
min* data-fv-between___min or min Float The lower value in the range

If you use min and max attributes, please set type="range".

Using with ES6 module

Basic Example

The following example validates latitude and longitude values.

A valid latitude must be between -90.0 and 90.0, and valid longitude may range from -180.0 to 180.0.

ES6 Module Example

The following snippet shows how to use the between validator with ES6 module:

Related validators

The following validators might be useful to you.