step validator
Check if the value is valid step one
Options
Using with form field
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 the ES6 module
import { step } from '/vendors/@form-validation/cjs/validator-step';
const result = step().validate({
value: ...,
options: {
baseValue: ...,
message: ...,
step: ...,
},
});
Using the npm package
- Install the validator package:
$ npm install @form-validation/validator-step
import { step } from '@form-validation/validator-step';
const result = step().validate({
value: ...,
options: {
baseValue: ...,
message: ...,
step: ...,
},
});
Changelog
- Fixed an issue that the
step
option isn't passed to the placeholder message