Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
how to validate Indian IFSC code(SBIN0015916) code on key press event in javascript.These are the rules for validating first 4 are alphabets and last 6 are numerics.
Posted
Comments
Sergey Alexandrovich Kryukov 26-Sep-14 2:26am    
Please don't re-post.
—SA

Try below :


C#
$(document).ready(function () {
        $('#TextBoxID').keypress(function (event) {
            var keycode = (event.keyCode ? event.keyCode : event.which);
            var TextValue = document.getElementById("TextBoxID").value;
            var firstFourLetter =  TextValue.substring(1,4); 
            var lastFourLetter = TextValue.substring(5,10);
            if (firstFourLetter.keycode >= '65' && lastFourLetter.keycode <= '90') {
                return true;
            }
            return false;
        });
    });
 
Share this answer
 
v2
Regular Expression for IFSC CODE [Resolved][^]

Check this may be this would help you.
Thanks
:)
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900