jQuery.noConflict(); jQuery(document).ready(function($) { jQuery.formValidator.initConfig({formid:"quickOpenAccoForm",submitonce:true,onerror:function(msg){} }); jQuery("#customerappellation").formValidator({tipid:"tip_customerappellation",onshow:"",onfocus:"",oncorrect:""}).inputValidator({min:1,empty:{leftempty:false,rightempty:false,emptyerror:"请输入真实姓名!"},onerror:"请输入真实姓名!"}).regexValidator({regexp:"^[\\u4E00-\\u9FA5\\uf900-\\ufa2d]{2,15}$|^[\\u4E00-\\u9FA5\\uf900-\\ufa2d]{1,10}(\\·|\\.){0,1}[\\u4E00-\\u9FA5\\uf900-\\ufa2d]{1,15}$|^[a-zA-Z]{1,20}$",onerror:"真实姓名只能含汉字、字母、符号中的空格和点,且至少两个字!"}) jQuery("#customerappellation").keyup(function(){var str=this.value;var result="";var flag=false;for (var i = 0; i < str.length; i++){ if (str.charCodeAt(i)==12288){ flag = true; result+= String.fromCharCode(str.charCodeAt(i)-12256); continue; } if (str.charCodeAt(i)>65280 && str.charCodeAt(i)<65375){ flag = true; result+= String.fromCharCode(str.charCodeAt(i)-65248); }else{ result+= String.fromCharCode(str.charCodeAt(i)); }}if(flag) {this.value=result;}}); jQuery("#identitytype").formValidator({tipid:"tip_identitytype",onshow:"",onfocus:"",oncorrect:""}).inputValidator({min:1,empty:{leftempty:false,rightempty:false,emptyerror:""},onerror:""}) jQuery("#identitytype").keyup(function(){var str=this.value;var result="";var flag=false;for (var i = 0; i < str.length; i++){ if (str.charCodeAt(i)==12288){ flag = true; result+= String.fromCharCode(str.charCodeAt(i)-12256); continue; } if (str.charCodeAt(i)>65280 && str.charCodeAt(i)<65375){ flag = true; result+= String.fromCharCode(str.charCodeAt(i)-65248); }else{ result+= String.fromCharCode(str.charCodeAt(i)); }}if(flag) {this.value=result;}}); jQuery("#identityno").formValidator({tipid:"tip_identityno",onshow:"",onfocus:"",oncorrect:""}).inputValidator({min:1,empty:{leftempty:false,rightempty:false,emptyerror:"证件号码不能为空!身份证用户请点击证件上传!"},onerror:"证件号码不能为空!身份证用户请点击证件上传!"}).functionValidator({ onshow:"证件号码格式错误", fun: validateIdentify }) jQuery("#identityno").keyup(function(){var str=this.value;var result="";var flag=false;for (var i = 0; i < str.length; i++){ if (str.charCodeAt(i)==12288){ flag = true; result+= String.fromCharCode(str.charCodeAt(i)-12256); continue; } if (str.charCodeAt(i)>65280 && str.charCodeAt(i)<65375){ flag = true; result+= String.fromCharCode(str.charCodeAt(i)-65248); }else{ result+= String.fromCharCode(str.charCodeAt(i)); }}if(flag) {this.value=result;}}); jQuery("#authcode").formValidator({tipid:"tip_authcode",onshow:"",onfocus:"",oncorrect:""}).inputValidator({min:1,empty:{leftempty:false,rightempty:false,emptyerror:"请输入校验码!"},onerror:"请输入校验码!"}).regexValidator({regexp:"^\[0-9]{4}$",onerror:"请输入正确的校验码!"}) jQuery("#authcode").keyup(function(){var str=this.value;var result="";var flag=false;for (var i = 0; i < str.length; i++){ if (str.charCodeAt(i)==12288){ flag = true; result+= String.fromCharCode(str.charCodeAt(i)-12256); continue; } if (str.charCodeAt(i)>65280 && str.charCodeAt(i)<65375){ flag = true; result+= String.fromCharCode(str.charCodeAt(i)-65248); }else{ result+= String.fromCharCode(str.charCodeAt(i)); }}if(flag) {this.value=result;}}); jQuery("#mobile").formValidator({tipid:"tip_mobile",onshow:"",onfocus:"",oncorrect:""}).functionValidator({ fun : function(val,em) { if(typeof(checkMobile)!='undefined' && jQuery.isFunction(checkMobile)) { return checkMobile(val,em); } return true;} }) jQuery("#mobile").keyup(function(){var str=this.value;var result="";var flag=false;for (var i = 0; i < str.length; i++){ if (str.charCodeAt(i)==12288){ flag = true; result+= String.fromCharCode(str.charCodeAt(i)-12256); continue; } if (str.charCodeAt(i)>65280 && str.charCodeAt(i)<65375){ flag = true; result+= String.fromCharCode(str.charCodeAt(i)-65248); }else{ result+= String.fromCharCode(str.charCodeAt(i)); }}if(flag) {this.value=result;}}); function validateIdentify(val,elem) { var identitytype = $("#identitytype").val();var identityno = $("#identityno").val();try{identityno = Trim(identityno)}catch(error){}if(identitytype == "0") { reg = /^(\d{15}|\d{18}|\d{17}[A-Z]{1})$/; if(!reg.test(identityno)) return "请输入正确的身份证号码!"; var result = isCardID(identityno) == true ? true : false; if(!result) return "请输入正确的身份证号码!"; } else if(identitytype == "1") { reg = /^([\u4e00-\u9fa5\w\d\-]{3,})$/; if(!reg.test(identityno)) return "请输入正确的中国护照号码!";} else if(identitytype == "2") { reg = /^([\u4e00-\u9fa5\w\d\-]{4,})$/; if(!reg.test(identityno)) return "请输入正确的军官证号码!";} else if(identitytype == "3") { reg = /^([\u4e00-\u9fa5\w\d\-]{3,})$/; if(!reg.test(identityno)) return "请输入正确的士兵证号码!";} else if(identitytype == "4") { reg = /^([\u4e00-\u9fa5\w\d\-]{3,})$/; if(!reg.test(identityno)) return "港澳来往内地通行证格式不正确";} else if(identitytype == "5") { reg = /^([\u4e00-\u9fa5\w\d\-]{3,})$/; if(!reg.test(identityno)) return "请输入正确户口本/出生证号码!";} else if(identitytype == "7") { reg = /^(.+)$/; if(!reg.test(identityno)) return "请输入正确的其他证件号码!";} else if(identitytype == "8") { reg = /^([\u4e00-\u9fa5\w\d\-]{3,})$/; if(!reg.test(identityno)) return "文职格式不正确";} else if(identitytype == "A") { reg = /^([\u4e00-\u9fa5\w\d\-]{6,})$/; if(!reg.test(identityno)) return "台胞证格式不正确";} else if(identitytype == "B") { reg = /^([\u4e00-\u9fa5\w\d\-]{6,})$/; if(!reg.test(identityno)) return "外国人永久居留证格式不正确";} return true;}; $("#identitytype").change(function () { getTriggerEvent();}); $("#identityno").focus(function () { getTriggerEvent();}); function getTriggerEvent() { if($("#identitytype").val() == "0") { } else if($("#identitytype").val() == "1") { } else if($("#identitytype").val() == "2") { } else if($("#identitytype").val() == "3") { } else if($("#identitytype").val() == "4") { } else if($("#identitytype").val() == "5") { } else if($("#identitytype").val() == "6") { } else if($("#identitytype").val() == "7") { } else if($("#identitytype").val() == "8") { } else if($("#identitytype").val() == "A") { } else if($("#identitytype").val() == "B") { } else { $("#tip_identityno").html("系统不支持的证件类型").removeClass().addClass("onFocus"); }; } });