<asp:TextBox ID="AN_UC7_txtpan" runat="server" class="input-style-newone" onkeyup="return CheckPAN(this.id,event,'CPH1_ID_AN_ODProposer_AN_UC7_lblerrpan');"
onkeypress="return CheckPAN(this.id,event,'CPH1_ID_AN_ODProposer_AN_UC7_lblerrpan'); "
MaxLength="10" TabIndex="5" oncopy ="return false" onpaste="return false" oncut="return false" ></asp:TextBox>
<div class="error-box" style="width: 500px">
<div class="error-box-inner">
<asp:Image ID="AN_UC7_Imgerriconpan" runat="server" src="images/error-icon.jpg" Style="margin: 0 5px -1px 0;
display: none" />
<asp:Label ID="AN_UC7_lblerrpan" runat="server" Text=""></asp:Label>
</div>
</div>
function IsOnlyNumeric(strString) {
var strValidChars = "0123456789";
var strChar;
var blnResult = true;
for (i = 0; i < strString.length && blnResult == true; i++) {
strChar = strString.charAt(i);
if (strValidChars.indexOf(strChar) == -1) {
blnResult = false;
}
}
return blnResult;
}
function CheckPAN(obj, evt, lblname) {
var lbl = lblname;
var ctrlname = obj;
var ucctrlname = ctrlname;
var strInitial = ucctrlname;
var code = (evt.which) ? evt.which : evt.keyCode ? evt.keyCode : evt.charCode;
//For IE7 browser
if (typeof String.prototype.trim !== 'function') {
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g, '');
}
}
if (navigator.userAgent.search("Firefox") != -1) {
if (code == 32 || code == 190) {
var pancard = document.getElementById(obj).value;
document.getElementById(obj).value = pancard.substring(0, pancard.length - 1);
}
}
if ((code >= 65 && code <= 90) || (code >= 97 && code <= 122) || (code >= 48 && code <= 57) || (code == 13 || code == 8 || code == 9)) {
var pancard = document.getElementById(obj).value;
if ((pancard.trim().length > 0 && IsOnlyNumeric(pancard.charAt(0).toString()) == true) || (pancard.trim().length > 1 && IsOnlyNumeric(pancard.charAt(1).toString()) == true) || (pancard.trim().length > 2 && IsOnlyNumeric(pancard.charAt(2).toString()) == true) || (pancard.trim().length > 3 && IsOnlyNumeric(pancard.charAt(3).toString()) == true) || (pancard.trim().length > 4 && IsOnlyNumeric(pancard.charAt(4).toString()) == true)) {
document.getElementById(obj).value = pancard.substring(0, pancard.length - 1);
document.getElementById(lbl).innerHTML = ""; //"Starting five digits should be Alphabets";
if (pancard.trim().length == 1) {
document.getElementById(obj).value = "";
}
return false;
}
if ((pancard.trim().length > 5 && IsOnlyNumeric(pancard.charAt(5).toString()) == false) || (pancard.trim().length > 6 && IsOnlyNumeric(pancard.charAt(6).toString()) == false) || (pancard.trim().length > 7 && IsOnlyNumeric(pancard.charAt(7).toString()) == false) || (pancard.trim().length > 8 && IsOnlyNumeric(pancard.charAt(8).toString()) == false)) {
document.getElementById(obj).value = pancard.substring(0, pancard.length - 1);
document.getElementById(lbl).innerHTML = ""; //"6,7,8 & 9th digits should be numeric";
return false;
}
if (pancard.trim().length > 9 && IsOnlyNumeric(pancard.charAt(9).toString()) == true) {
document.getElementById(obj).value = pancard.substring(0, pancard.length - 1);
document.getElementById(lbl).innerHTML = ""; // "Last digit should be Alphabet";
return false;
}
}
else {
return false;
}
return true;
}
onkeypress="return CheckPAN(this.id,event,'CPH1_ID_AN_ODProposer_AN_UC7_lblerrpan'); "
MaxLength="10" TabIndex="5" oncopy ="return false" onpaste="return false" oncut="return false" ></asp:TextBox>
<div class="error-box" style="width: 500px">
<div class="error-box-inner">
<asp:Image ID="AN_UC7_Imgerriconpan" runat="server" src="images/error-icon.jpg" Style="margin: 0 5px -1px 0;
display: none" />
<asp:Label ID="AN_UC7_lblerrpan" runat="server" Text=""></asp:Label>
</div>
</div>
function IsOnlyNumeric(strString) {
var strValidChars = "0123456789";
var strChar;
var blnResult = true;
for (i = 0; i < strString.length && blnResult == true; i++) {
strChar = strString.charAt(i);
if (strValidChars.indexOf(strChar) == -1) {
blnResult = false;
}
}
return blnResult;
}
function CheckPAN(obj, evt, lblname) {
var lbl = lblname;
var ctrlname = obj;
var ucctrlname = ctrlname;
var strInitial = ucctrlname;
var code = (evt.which) ? evt.which : evt.keyCode ? evt.keyCode : evt.charCode;
//For IE7 browser
if (typeof String.prototype.trim !== 'function') {
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g, '');
}
}
if (navigator.userAgent.search("Firefox") != -1) {
if (code == 32 || code == 190) {
var pancard = document.getElementById(obj).value;
document.getElementById(obj).value = pancard.substring(0, pancard.length - 1);
}
}
if ((code >= 65 && code <= 90) || (code >= 97 && code <= 122) || (code >= 48 && code <= 57) || (code == 13 || code == 8 || code == 9)) {
var pancard = document.getElementById(obj).value;
if ((pancard.trim().length > 0 && IsOnlyNumeric(pancard.charAt(0).toString()) == true) || (pancard.trim().length > 1 && IsOnlyNumeric(pancard.charAt(1).toString()) == true) || (pancard.trim().length > 2 && IsOnlyNumeric(pancard.charAt(2).toString()) == true) || (pancard.trim().length > 3 && IsOnlyNumeric(pancard.charAt(3).toString()) == true) || (pancard.trim().length > 4 && IsOnlyNumeric(pancard.charAt(4).toString()) == true)) {
document.getElementById(obj).value = pancard.substring(0, pancard.length - 1);
document.getElementById(lbl).innerHTML = ""; //"Starting five digits should be Alphabets";
if (pancard.trim().length == 1) {
document.getElementById(obj).value = "";
}
return false;
}
if ((pancard.trim().length > 5 && IsOnlyNumeric(pancard.charAt(5).toString()) == false) || (pancard.trim().length > 6 && IsOnlyNumeric(pancard.charAt(6).toString()) == false) || (pancard.trim().length > 7 && IsOnlyNumeric(pancard.charAt(7).toString()) == false) || (pancard.trim().length > 8 && IsOnlyNumeric(pancard.charAt(8).toString()) == false)) {
document.getElementById(obj).value = pancard.substring(0, pancard.length - 1);
document.getElementById(lbl).innerHTML = ""; //"6,7,8 & 9th digits should be numeric";
return false;
}
if (pancard.trim().length > 9 && IsOnlyNumeric(pancard.charAt(9).toString()) == true) {
document.getElementById(obj).value = pancard.substring(0, pancard.length - 1);
document.getElementById(lbl).innerHTML = ""; // "Last digit should be Alphabet";
return false;
}
}
else {
return false;
}
return true;
}