中国电动汽车网
官方app下载

  • 标准格式
  • 文本格式
服务热线:400-855-7708  
*代理需求:
*公司/姓名:
*手机:

 

 

 

 

 

 

 

 

 

客户服务

热线:400-855-7708
周一至周五9:00-19:00
function setContentTab(a, b, c) { var d, e; for (i = 1; c >= i; i++) d = document.getElementById(a + i), e = document.getElementById("con_" + a + "_" + i), d.className = i == b ? "on" : "", e.style.display = i == b ? "block" : "none" } var strcheck = 1; var strname = 0; var strpwd = 0; var strrepwd = 0; var strcom = 0; var strphone = 0; function checkall() { if (onblurBrand() && onblurcartype() && onblurcontacter() && onblurMobile()) { return true; } else { return false; } } function checkall2() { if (onblurdemand2() && onblurcontacter2() && onblurMobile2()) { return true; } else { return false; } } function GetDomID(str) { return document.getElementById(str); } function trim(str) { return str.replace(/^\s+|\s+$/g, ""); } function ValidateAccount(username) { var pattern = /^[a-zA-Z][a-zA-Z0-9_]{4,20}$/; return pattern.test(username); } function testVal(strOId, mType) { var re, rp; switch (mType) { case "ID": //用户名 re = /^\w{4,15}$/; break; case "PW": //密码 re = /^\w{4,20}$/; break; case "PC": //国家区号 re = /^\d{2,6}$/; break; case "PA": //城市区号 re = /^\d{2,6}$/; break; case "PN": //电话号码 re = /^[0-9,-]{5,30}$/; break; case "FN": //传真号码 re = /^[0-9,-]{7,30}$/; break; case "MP": //手机 //re = /^((\(\d{3}\))|(\d{3}\-))?13[0-9]\d{8}$|013[0-9]\d{8}$|015\d{9}$|15\d{9}$/; re = /^((\(\d{3}\))|(\d{3}\-))?0?1[34578][0-9]\d{8}([,]((\(\d{3}\))|(\d{3}\-))?0?1[34578][0-9]\d{8}){0,2}$/; break; case "Zip": //邮编 re = /^\d{6}$/; break; case "EM": //电子邮箱 re = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/; break; case "Url": //网址 re = /([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/; //不包括"http://" //re = /http:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/; break; case "Num": // re = /^\d{1,10}$/; break; case "Money": re = /^[0-9]+(.[0-9]{1,2})?$/; break; case "Float": re = /^[0-9]+(.[0-9]{1,10})?$/; break; default: alert("出错啦!"); return; } rp = re.test(trim(strOId)); return (rp); } function onblurBrand() { var txtbrandname = GetDomID("txtbrandname"); var divbrandname = GetDomID("divbrandname"); if (txtbrandname.value == '') { divbrandname.innerHTML = '请填写意向品牌'; return false; } else { divbrandname.innerHTML = '填写正确'; return true; } } function onblurcartype() { var txtcartype = GetDomID("txtcartype"); var divcartype = GetDomID("divcartype"); if (txtcartype.value == '') { divcartype.innerHTML = '请填写已代理品牌情况!'; return false; } else { divcartype.innerHTML = '填写正确'; return true; } } function onblurcontacter() { var txtcontacter = GetDomID("txtcontacter"); var divcontacter = GetDomID("divcontacter"); if (txtcontacter.value == '') { divcontacter.innerHTML = '请填写联系人名称'; return false; } else { divcontacter.innerHTML = '填写正确'; return true; } } function onblurMobile() { var txtMobile = GetDomID("txtmobile"); var divMobile = GetDomID("divMobile"); if (txtMobile.value == '') { divMobile.innerHTML = '请填写联系方式'; return false; } else if (testVal(txtMobile.value, "MP")) { divMobile.innerHTML = '填写正确'; return true; } else { divMobile.innerHTML = '请填写正确的号码。'; return false; } return false; } function onblurdemand2() { var txtcontacter = GetDomID("txtdemand"); var divcontacter = GetDomID("divdemand"); if (txtcontacter.value == '') { divcontacter.innerHTML = '请填写代理需求'; return false; } else { divcontacter.innerHTML = '填写正确'; return true; } } function onblurcontacter2() { var txtcontacter = GetDomID("txtcontacter2"); var divcontacter = GetDomID("divcontacter2"); if (txtcontacter.value == '') { divcontacter.innerHTML = '请填写公司或者联系人名称'; return false; } else { divcontacter.innerHTML = '填写正确'; return true; } } function onblurMobile2() { var txtMobile = GetDomID("txtmobile2"); var divMobile = GetDomID("div_mobile2"); if (txtMobile.value == '') { divMobile.innerHTML = '请填写联系方式'; return false; } else if (testVal(txtMobile.value, "MP")) { divMobile.innerHTML = '填写正确'; return true; } else { divMobile.innerHTML = '请填写正确的号码。'; return false; } return false; }