ein validator
Validate an EIN (Employer Identification Number)
Options
Using with form field
Name | HTML attribute | Type | Description |
---|
message | data-fv-ein___message | String | The error message |
Using with ES6 module
import ein from 'formvalidation/dist/es6/validators/ein';
const result = ein().validate({
value: ...,
options: {
message: ...,
},
});
Basic example
ES6 Module Example
The following snippet shows how to use the ein validator with ES6 module:
import ein from 'formvalidation/dist/es6/validators/ein';
const res1 = ein().validate({
value: '91-1144442',
options: {
message: 'The value is not valid EIN',
},
});
const res2 = ein().validate({
value: '123-45-6789',
options: {
message: 'The value is not valid EIN',
},
});