var idcardnoutil = ,
powers: ["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],
paritybit: ["1","0","x","9","8","7","6","5","4","3","2"],
genders: ,
checkaddresscode: function(addresscode)$/.test(addresscode);
if(!check) return false;
if(idcardnoutil.provinceandcitys[parseint(addresscode.substring(0,2))])else
},checkbirthdaycode: function(birdaycode)((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))$/.test(birdaycode);
if(!check) return false;
var yyyy = parseint(birdaycode.substring(0,4),10);
var mm = parseint(birdaycode.substring(4,6),10);
var dd = parseint(birdaycode.substring(6),10);
var xdata = new date(yyyy,mm-1,dd);
if(xdata > new date())else if ( ( xdata.getfullyear() == yyyy ) && ( xdata.getmonth () == mm - 1 ) && ( xdata.getdate() == dd ) )else
},getparitybit: function(idcardno)
var mod = power % 11;
return idcardnoutil.paritybit[mod];
},checkparitybit: function(idcardno)else
},checkidcardno: function(idcardno)|(\d(\d|x|x))$/.test(idcardno);
if(!check) return false;
//判斷長度為15位或18位
if(idcardno.length==15)else if(idcardno.length==18)else
},//校驗15位的身份證號碼
check15idcardno: function(idcardno)((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d$/.test(idcardno);
if(!check) return false;
//校驗位址碼
var addresscode = idcardno.substring(0,6);
check = idcardnoutil.checkaddresscode(addresscode);
if(!check) return false;
var birdaycode = '19' + idcardno.substring(6,12);
//校驗日期碼
return idcardnoutil.checkbirthdaycode(birdaycode);
},//校驗18位的身份證號碼
check18idcardno: function(idcardno)[1-9]\d((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d(\d|x|x)$/.test(idcardno);
if(!check) return false;
//校驗位址碼
var addresscode = idcardno.substring(0,6);
check = idcardnoutil.checkaddresscode(addresscode);
if(!check) return false;
//校驗日期碼
var birdaycode = idcardno.substring(6,14);
check = idcardnoutil.checkbirthdaycode(birdaycode);
if(!check) return false;
//驗證校檢碼
return idcardnoutil.checkparitybit(idcardno);
},formatedatecn: function(day),
//獲取資訊
getidcardinfo: function(idcardno);
if(idcardno.length==15)else
}else if(idcardno.length==18)else
}return idcardinfo;
},getid15:function(idcardno)else if(idcardno.length==18)else
},getid18: function(idcardno)else if(idcardno.length==18)else}};
//驗證護照是否正確
function checknumber(number))|(g\d)/;
var objexp=new regexp(expression);
if(objexp.test(str)==true)else
};
jquery.validator.addmethod("isidcardno", function(value, element) , "請正確輸入身份證號碼!");
// 手機號碼驗證
jquery.validator.addmethod("ismobile", function(value, element) )|(15[0-9])|(18[0-9]))+\d)$/.test(value));
return this.optional(element) || (length == 11);
}, "請正確填寫您的手機號碼!");
身份證號碼驗證
說明 驗證身份證的有效性 引數 cid 身份證號碼 返回 地方 出生時間 性別 private string checkcidinfo string cid if cid.length 18 char c cid cid.length 1 bool last false if c 0 c 9 c a...
驗證身份證號碼
好久沒更新了,今天簽到啦。感覺這個驗證挺重要的,也挺常用的,所以分享給需要的朋友。驗證身份證號碼,在網上找到的好東東 function checkidcard idcard var idcard,y,jym var s,m var idcard array new array idcard arra...
身份證號碼
每乙個人自出生後都會有乙個身份證號碼。根據我國有關部門規定,公民身份號碼是特徵組合碼,由十七位數字本體碼和一位數字校驗碼組成。排列順序從左至右依次為 六位數字位址碼,八位數字出生日期碼,三位數字順序碼和一位數字校驗碼。居民身份證是國家法定的證明公民個人身份的有效證件。例如 對於身份證號碼330719...