| Name | HTML attribute | Type | Description |
|---|---|---|---|
message
|
data-fv-vin___message
|
String
|
The error message |
// You might need to change the importing path
import
vin
from
'formvalidation/dist/es6/validators/vin'
;
const
result
=
vin
(
)
.
validate
(
{
value
:
...
,
options
:
{
message
:
...
,
}
,
}
)
;
/*
result is an object of
{
valid: true or false,
message: The error message
}
*/
// You might need to change the importing path
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'
,
}
,
}
)
;
// res1.valid === true
const
res2
=
vin
(
)
.
validate
(
{
value
:
'JTMKF4DV5B5309254'
,
options
:
{
message
:
'The value is not valid VIN'
,
}
,
}
)
;
// res2.valid === false