step validator

Check if the value is valid step one


Using with form field

The HTML attributes are used to set the validator options via the Declarative plugin

Name HTML attribute Type Description
baseValue data-fv-step___base-value Float The base value, default to 0
message data-fv-step___message String The error message
step data-fv-step___step Float The step, default to 1

Using with JavaScript module

// You might need to change the importing path
import step from 'formvalidation/validators/step';

const result = step().validate({
    value: ...,
    options: {
        baseValue: ...,
        message: ...,
        step: ...,
result is an object of
    valid: true or false,
    message: The error message