isin validator
Validate an ISIN (International Securities Identification Number)
Options
Using with form field
Name | HTML attribute | Type | Description |
---|
message | data-fv-isin___message | String | The error message |
Using the ES6 module
import { isin } from '/vendors/@form-validation/cjs/validator-isin';
const result = isin().validate({
value: ...,
options: {
message: ...,
},
});
Using the npm package
- Install the validator package:
$ npm install @form-validation/validator-isin
import { isin } from '@form-validation/validator-isin';
const result = isin().validate({
value: ...,
options: {
message: ...,
},
});
Basic example
NPM package example
The following snippet shows how to use the isin validator with the npm package:
import { isin } from '@form-validation/validator-isin';
const res1 = isin().validate({
value: 'US0378331005',
options: {
message: 'The value is not valid isin',
},
});
const res2 = isin().validate({
value: 'AA0000XVGZA3',
options: {
message: 'The value is not valid isin',
},
});
See also
Changelog