自己写的比较全js验证,供大家参考 //身份证验证 function checkIdcard(idcard1,showMsg){ var idcard=this.trim(idcard1);// 对身份证号码做处理。去除头尾空格。 var Errors=new Array( "验证通过!", "身份证号码位数不对!", "身份证号码出生日期超出范围或含有非法字符!", "身份证号码校验错误!", "身份证地区非法!" ); var area={11:"北京",12:"天津",13:"河北",1
/** * 防范SQL注入漏洞,检测输入的字符 * 需要检测的特殊字符及字符串有:",","-","/","//","'","%",""" * @param strInput 待检测的字符 * @author Tony Lin Added on 2008-10-21 */ function checkInputChar(strInput){ var forbidChar = new Array(",","-","/","//","'","%","/""); for (var i = 0;i =
代码如下: function checkIdcard(idcard){ var Errors=new Array( “验证通过”, “身份证号码位数不对!”, “身份证号码出生日期超出范围或含有非法字符!”, “身份证号码校验错误!”, “身份证地区非法!” ); var area={11:”北京”,12:”天津”,13:”河北”,14:”山西”,15:”内蒙古”,21:”辽宁”,22:”吉林”,23:”黑龙江”,31:”上海”,32:”江苏”,33:”浙江”,34:”安徽”,35:”福建”,3
function checkIdcard(idcard){ var Errors=new Array( “验证通过!”, “身份证号码位数不对!”, “身份证号码出生日期超出范围或含有非法字符!”, “身份证号码校验错误!”, “身份证地区非法!” ); var area={11:”北京”,12:”天津”,13:”河北”,14:”山西”,15:”内蒙古”,21:”辽宁”,22:”吉林”,23:”黑龙江”,31:”上海”,32:”江苏”,33:”浙江”,34:”安徽”,35:”福建”,36:”江西