rtn validator

Validate a RTN (Routing transit number)

Options

Use 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-rtn___message String The error message

Use with JavaScript module


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

const result = rtn().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 RTN.

Sample Is valid?
011103093
067014822
211274450
211370545
054001725
011400071
031201360
026013673
021302567
053902197
036001808
011600033

Module Example

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


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

const res1 = rtn().validate({
    value: '011103093',
    options: {
        message: 'The value is not valid RTN',
    },
});
// res1.valid === true

const res2 = rtn().validate({
    value: '054001726',
    options: {
        message: 'The value is not valid RTN',
    },
});
// res2.valid === false

Related validators

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

Name Description
bic Validate a BIC (Business Identifier Codes)
creditCard Validate a credit card number
iban Validate an International Bank Account Number (IBAN)