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