Click here to Skip to main content
12,896,175 members (51,997 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


3 bookmarked
Posted 28 Nov 2012

PAN Card Number Validation

, 28 Nov 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
Sample script for PAN card number validation.

PAN card number is a unique national number issued in India for tax related purposes.

To validate PAN card, call this line of code (JavaScript) on onblur like:

<asp:TextBox ID="txtpancard"

   runat="server"  Width="190px" 

   onblur="fnValidatePAN(this);" >
<script type="text/javascript" language="javascript">
    function fnValidatePAN(Obj) {
        if (Obj == null) Obj = window.event.srcElement;
        if (Obj.value != "") {
            ObjVal = Obj.value;
            var panPat = /^([a-zA-Z]{5})(\d{4})([a-zA-Z]{1})$/;
            var code = /([C,P,H,F,A,T,B,L,J,G])/;
            var code_chk = ObjVal.substring(3,4);
            if ( == -1) {
                alert("Invalid Pan No");
                return false;
            if (code.test(code_chk) == false) {
                alert("Invaild PAN Card No.");
                return false;


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


About the Author

United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170424.1 | Last Updated 28 Nov 2012
Article Copyright 2012 by ravindra5233
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid