imo validator
Validate an IMO (International Maritime Organization)
Options
Using with form field
Name | HTML attribute | Type | Description |
---|
message | data-fv-imo___message | String | The error message |
Using with ES6 module
import imo from 'formvalidation/dist/es6/validators/imo';
const result = imo().validate({
value: ...,
options: {
message: ...,
},
});
Basic example
ES6 Module Example
The following snippet shows how to use the imo validator with ES6 module:
import imo from 'formvalidation/dist/es6/validators/imo';
const res1 = imo().validate({
value: 'IMO 9074729',
options: {
message: 'The value is not valid IMO',
},
});
const res2 = imo().validate({
value: '9074729',
options: {
message: 'The value is not valid IMO',
},
});