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 the ES6 module
import { ein } from '/vendors/@form-validation/cjs/validator-ein';
const result = ein().validate({
value: ...,
options: {
message: ...,
},
});
Using the npm package
- Install the validator package:
$ npm install @form-validation/validator-ein
import { ein } from '@form-validation/validator-ein';
const result = ein().validate({
value: ...,
options: {
message: ...,
},
});
Basic example
NPM package example
The following snippet shows how to use the ein validator with the npm package:
import { ein } from '@form-validation/validator-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',
},
});
Changelog