rtn validator

Validate a RTN (Routing transit number)

Options

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

Basic example

rtn validator

ES6 Module Example

The following snippet shows how to use the rtn validator with ES6 module:
// You might need to change the importing path
import rtn from 'formvalidation/dist/es6/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

See also