isin validator

Validate an ISIN (International Securities Identification Number)

Options

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

Basic example

isin validator

ES6 Module Example

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

See also