bic validator

Validate a BIC (Business Identifier Codes)

Options

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

Basic example

bic validator

ES6 Module Example

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

See also