bic validator
Validate a BIC (Business Identifier Codes)
Options
Using with form field
Name | HTML attribute | Type | Description |
---|
message | data-fv-bic___message | String | The error message |
Using the ES6 module
import { bic } from '/vendors/@form-validation/cjs/validator-bic';
const result = bic().validate({
value: ...,
options: {
message: ...,
},
});
Using the npm package
- Install the validator package:
$ npm install @form-validation/validator-bic
import { bic } from '@form-validation/validator-bic';
const result = bic().validate({
value: ...,
options: {
message: ...,
},
});
Basic example
NPM package example
The following snippet shows how to use the bic validator with the npm package:
import { bic } from '@form-validation/validator-bic';
const res1 = bic().validate({
value: 'DSBACNBXSHA',
options: {
message: 'The value is not valid BIC',
},
});
const res2 = bic().validate({
value: 'RZ00AT2L303',
options: {
message: 'The value is not valid BIC',
},
});
See also
Changelog