sedol validator

Validate a SEDOL (Stock Exchange Daily Official List)

Options

Using with form field
The HTML attributes are used to set the validator options via the Declarative plugin
NameHTML attributeTypeDescription
messagedata-fv-sedol___messageStringThe error message
Using the ES6 module
// You might need to change the importing path
import { sedol } from '/vendors/@form-validation/cjs/validator-sedol';
const result = sedol().validate({
value: ...,
options: {
message: ...,
},
});
/*
result is an object of
{
valid: true or false,
message: The error message
}
*/
Using the npm package
  • Install the validator package:
$ npm install @form-validation/validator-sedol
  • Use the sedol validator:
import { sedol } from '@form-validation/validator-sedol';
const result = sedol().validate({
value: ...,
options: {
message: ...,
},
});

Basic example

sedol validator

NPM package example

The following snippet shows how to use the sedol validator with the npm package:
import { sedol } from '@form-validation/validator-sedol';
const res1 = sedol().validate({
value: '0263494',
options: {
message: 'The value is not valid SEDOL',
},
});
// res1.valid === true
const res2 = sedol().validate({
value: 'B0WNLY8',
options: {
message: 'The value is not valid SEDOL',
},
});
// res2.valid === false

See also

Changelog

v2.0.0
  • Add the npm package