Getting Started
Events

step validator

Check if the value is valid step one

Options

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 ES6 module
            
// You might need to change the importing path
import step from 'formvalidation/dist/es6/validators/step' ;
const result = step ( ) . validate ( {
value : ... ,
options : {
baseValue : ... ,
message : ... ,
step : ... ,
} ,
} ) ;
/*
result is an object of
{
valid: true or false,
message: The error message
}
*/

Changelog

v1.6.0
  • Fixed an issue that the step option isn't passed to the placeholder message