文章出處
文章列表
if( obj && customerCertiType=="11"){ if(!obj.match(/^\w{18}$/) && !obj.match(/^\w{15}$/)){ //obj.focus(); if(window.alert("身份證號長度應為18位或15位!")){ return ; } }else{ var year; var month; var date; if(obj.length == 18){ if(identifyVerify(obj)){ year = obj.substring(6,10); month = obj.substring(10,12); date = obj.substring(12,14); var sexMrk = obj.substring(16,17); if(sexMrk % 2 == 0){ tool.setAttrValue(dwName,"gender","F");//mxt //issTool.setAttrValue(dw[prefix],prefix+".CSex",[2,'女']); }else{ tool.setAttrValue(dwName,"gender","M");//mxt //issTool.setAttrValue(dw[prefix],prefix+".CSex",[1,'男']); } }else{ alert("身份證號校驗錯誤!"); //obj = ""; //obj.focus(); return ; } } if(obj.length == 15){ year = obj.substring(6,8); month = obj.substring(8,10); date = obj.substring(10,12); var toYear = String(new Date().getFullYear()).substring(2,4); year = "19" + year; var sexMrk = obj.substring(14,15); if(sexMrk % 2 == 0){ tool.setAttrValue(dwName,"gender","F");//mxt //issTool.setAttrValue(dw[prefix],prefix+".CSex",[2,'女']); }else{ tool.setAttrValue(dwName,"gender","M");//mxt //issTool.setAttrValue(dw[prefix],prefix+".CSex",[1,'男']); } } if(year < 1900 || year > new Date().getFullYear() || month > 12 || month < 1 || date > 31 || date < 1){ alert("出生日期:" + year + "年" + month + "月" + date + "日 不是合法日期,請檢查"); //obj = ""; //obj.focus(); return ; } var ageMrk = parseInt(new Date().getFullYear()) - parseInt(year); } }else{//非身份證 }
文章列表
全站熱搜
留言列表