REGULAR EXPRESSION FOR INDIA PAN CARD NUMBER

REGULAR EXPRESSION TO VALIDATE TEXTBOX FOR INDIA PAN CARD NUMBER


We can use Regular Expression to validate indian pan card number in textbox . Regular expression for India Pan Card Number
^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$

Inline HTML Code (which can be used): <input type="text" size="15" required pattern="^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$" />

CSS Code - Changes the Color after validation takes place.

input:valid {
    background: #afa; /* green input*/
}
input:invalid {
    background: #faa; /* red input */
}


example shown on - http://jsfiddle.net/BenedictLewis/mA3MV/

No comments:

Post a Comment