The Routing number is a nine digit code that’s based on U.S Bank location where your account was opened. People often used routing number when making payment online or by phone.
The routing number is sensitive information, In USA if you know checking account number and routing number of some one you can make online payment. Organization must make account number and routing number as mask on payment page so that nobody take snapshot and see these detail for fraud.
See Also :
- Log4j2: How to Mask Logs Personal/Confidential/SPI Information
- How to Mask JSON Confidential/Personal Information in logs :JAVA
- How to mask JAVA Object confidential/personal information in logs while Printing
- How to MASK XML Confidential/Personal Data : JAVA
- How to mask Personal/Confidential Information on web page
Routing Number masking Example:
Here routing number of length 9 digits. By masking will hide all digits. For example, my routing number is 123456789 than after mask will display as XXXXXXXXX.
![]() | ![]() |
HTML Changes
Create a text box on your page with html as attached in download section.
Java Script/JQuery Changes
Copy below java script in your head section of page.
var originalVal;
$(document).ready(function()
{
if($('#txtRN').val().length>0)
{
if($('#txtRN').val().indexOf("X")==-1)
{
originalVal=$('#txtRN').val();
}
maskRN(this);
}
$('#txtRN').blur( function(e)
{
if($('#txtRN').val().indexOf("X")==-1)
{
originalVal=$('#txtRN').val();
}
maskRN(this);
});
$('#txtRN').focus( function(e)
{
$(this).val(originalVal);
});
});
function maskRN(regularRN)
{
var varlen =$(regularRN).val().length;
if(varlen > 9)
{
$("#error").text('Not Valid Routing Number.');
}
else
{
$("#error").text('');
//Replace all characters with X
var mask = $(regularRN).val().replace(/./gi, 'X');
$(regularRN).val(mask);
}
}
Note :
This masking example is created considering standard length of text size and formatting of text field, that can vary accounding to oraganizations. If your oraganization having different format and text size modify source code according to your need.
If you are facing any issue drop a comments will try to connect as soon as possible.
Download Source code
To download the source code of this example, click on below given download link. Mask Routing Number
Drop me your questions in comments section.
References
- https://www.rbi.org.in/scripts/PublicationReportDetails.aspx?ID=695
- htps://en.wikipedia.org/wiki/International_Bank_Account_Number
Related Posts
Your Feedback Motivate Us
If our FacingIssuesOnIT Experts solutions guide you to resolve your issues and improve your knowledge. Please share your comments, like and subscribe to get notifications for our posts.
Happy Learning !!!
Hey,
Perfectly written. routing number plays an important role while making a wire transfer. Every bank has a unique routing number that two banks can’t have the same number. May one bank can have multiple routing numbers as per location, branch, etc. Such as Wells Fargo has multiple wells fargo routing number s.
Thanks, Alina for your comments.