portal html css js resource

form.js 3.2KB

    var ifEmail =false; var ifPassword; function ainf() { var txtEnun=document.getElementById("nam"); if(txtEnun.value.length==0){ $(".msg4 span").replaceWith("请输入您的邮箱地址"); }else{ var hun=/\s+/; if(hun.test(txtEnun.value.trim())){ $(".msg4 span").replaceWith("请输入"); }else{ var gunf=/^\w+@\w+\.((cn)|(com)|(com\.cn))$/; if(gunf.test(txtEnun.value.trim())){ ifEmail=true; $(".msg4 span").replaceWith=(""); }else{ $(".msg4 span").replaceWith=("输入的Email格式不对"); } } } } function code(){ var txting=document.getElementById("nam2"); if(txting.value.length==0){ ifEmail=false; $(".msg2 span").replaceWith("请输入您的特邀专家邀请码"); }else{ var hun=/^\d{6}/; if(hun.test(txting.value.trim())){ ifEmail=true; $(".msg2").replaceWith(""); } } } function suin(){ var txting=document.getElementById("nam1"); if(txting.value.length==0){ ifEmail=false; $(".msg1 span").replaceWith("请输入您的手机号"); }else{ var hun=/^1[3|4|5|7|8]\d{9}$/; if(hun.test(txting.value.trim())){ ifEmail=true; $(".msg1").replaceWith(""); }else{ $(".msg1 span").replaceWith("请输入有效的手机号"); } } } function hunfd(){ var txthunf=$$stin("nam3"); if(txthunf.value.length==0){ var txtnun=$$stin("spaninfo2"); ifEmail=false; $(".msg3 span").replaceWith("请输入密码"); }else{ var hun=/\s+/; if(hun.test(txthunf.value.trim())){ ifEmail=false; $(".msg3 span").replaceWith("输入"); }else{ ifPassword=$$stin("nam3").value; var sas=/^\d+$/; if(sas.exec(ifPassword)){ ifEmail=false; $(".msg3 span").replaceWith("不能为纯数字"); }else{ } } } } function hunfd1(){ var txthunf1=$$stin("nam4"); if(txthunf1.value.length==0){ ifEmail=false; var txtnun1=$$stin("spaninfo3"); $(".msg5 span").replaceWith("输入错误");}else{ if(ifPassword==txthunf1.value){ $(".msg5 span").replaceWith(""); ifEmail=true; }else{ ifEmail=false; $(".msg5 span").replaceWith("新密码两次输入不相同"); } } } function gunf(){ var fund=$$stin("nam5"); var fund1=$$stin("nam6"); } var selectDefault=""; window.onload=function(){ selectDefault=$$stin("nam8").children[0]; } function find(obj){ var selectValue=obj.value; $$stin("nam8").options.length=0; switch(selectValue){ case "1": $$stin("nam8").appendChild(selectDefault); break; case "2": var hunf=new Array("东城区","西城区", "宣武区", "崇文区" ,"石景山区" ,"朝阳区", "海淀区", "大兴区", "丰台区"); for(var i=0;i<hunf.length;i++){ var hun=hunf[i]; var createElement=document.createElement("option"); createElement.innerText=hun; $$stin("nam8").appendChild(createElement); } break; case "3": var hunf1=new Array("宝山区","杨浦区","虹口区","闸北区","普陀区","长宁区","徐汇区","闵行区","静安区","卢湾区","黄浦区"); for(var i=0;i<hunf1.length;i++){ var hun1=hunf1[i]; var createElement1=document.createElement("option"); createElement1.innerHTML=hun1; $$stin("nam8").appendChild(createElement1); } break case "4": break; default : break; } } function $$stin(id){ return document.getElementById(id); } function checkAll(){ if(ifEmail==true){ return true; }else{ return false; } }