ismn validator
Validate an ISMN (International Standard Music Number)
Options
Using with form field
Name | HTML attribute | Type | Description |
---|
message | data-fv-ismn___message | String | The error message |
Using with ES6 module
import ismn from 'formvalidation/dist/es6/validators/ismn';
const result = ismn().validate({
value: ...,
options: {
message: ...,
},
});
Basic example
ES6 Module Example
The following snippet shows how to use the ismn validator with ES6 module:
import ismn from 'formvalidation/dist/es6/validators/ismn';
const res1 = ismn().validate({
value: 'M230671187',
options: {
message: 'The value is not valid ISMN',
},
});
const res2 = ismn().validate({
value: '9790060115614',
options: {
message: 'The value is not valid ISMN',
},
});
See also
Changelog
- Fix an issue that the ismn validator passes an invalid ISMN which ends with 0