issn validator

Validate an ISSN (International Standard Serial Number)

Options

Using with form field
The HTML attributes are used to set the validator options via the Declarative plugin
NameHTML attributeTypeDescription
messagedata-fv-issn___messageStringThe error message
Using with ES6 module
// You might need to change the importing path
import issn from 'formvalidation/dist/es6/validators/issn';
const result = issn().validate({
value: ...,
options: {
message: ...,
},
});
/*
result is an object of
{
valid: true or false,
message: The error message
}
*/

Basic example

issn validator

ES6 Module Example

The following snippet shows how to use the issn validator with ES6 module:
// You might need to change the importing path
import issn from 'formvalidation/dist/es6/validators/issn';
const res1 = issn().validate({
value: '0024-9319',
options: {
message: 'The value is not valid ISSN',
},
});
// res1.valid === true
const res2 = issn().validate({
value: '0032-147X',
options: {
message: 'The value is not valid ISSN',
},
});
// res2.valid === false

See also