vin validator
Validate an US VIN (Vehicle Identification Number)
Options
Using with form field
| Name | HTML attribute | Type | Description |
|---|
message | data-fv-vin___message | String | The error message |
Using with ES6 module
import vin from 'formvalidation/dist/es6/validators/vin';
const result = vin().validate({
value: ...,
options: {
message: ...,
},
});
Basic example
ES6 Module Example
The following snippet shows how to use the vin validator with ES6 module:
import vin from 'formvalidation/dist/es6/validators/vin';
const res1 = vin().validate({
value: '192.168.1.1',
options: {
message: 'The value is not valid IP address',
},
});
const res2 = vin().validate({
value: 'JTMKF4DV5B5309254',
options: {
message: 'The value is not valid VIN',
},
});