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

Name HTML attribute Type Description
message data-fv-bic___message String The error message

Using with JavaScript module


// You might need to change the importing path
import bic from 'formvalidation/validators/bic';

const result = bic().validate({
    value: ...,
    options: {
        message: ...,
    },
});
/*
result is an object of
{
    valid: true or false,
    message: The error message
}
*/

Basic Example

You can click on sample to see if it's a valid or invalid BIC.

Sample Is valid?
ASPKAT2LXXX
ASPKAT2L
DSBACNBXSHA
UNCRIT2B912
DABADKKK
RZOOAT2L303
ASPKAT2LXX
ASPKAT2LX
ASPKAT2LXXX1
DABADKK
RZ00AT2L303
1SBACNBXSHA
D2BACNBXSHA
DS3ACNBXSHA
DSB4CNBXSHA
DSBA5NBXSHA
DSBAC6BXSHA
1S3AC6BXSHA

Module Example

The following snippet shows how to use the bic validator with JavaScript module:


// You might need to change the importing path
import bic from 'formvalidation/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

Related validators

The following validators are similar to this one and might be useful to you.

Name Description
creditCard Validate a credit card number
iban Validate an International Bank Account Number (IBAN)
rtn Validate a RTN (Routing transit number)