PAN syntax Validation in Jquery

0
55
Jquery

This example explains how to validate Indian PAN syntax in html page using jquery.

var pan = $('#pan').val();
var reg = '/^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$/';

if(reg.test(pan)){
   console.log('Valid');
} else {
console.log('invalid PAN');
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here