日期:2014-05-16 浏览次数:20372 次
function p_name(){ var name=document.getElementById("username").value; var reg=/^\w{3,12}$/; if(!reg.test(name)){ document.getElementById("userText").innerHTML="<font size=2 color=red>用户名至少3个字符</font>"; } else{ document.getElementById("userText").innerHTML=""; } } function p_passwd(){ var passwd=document.getElementById("password1").value; var reg=new RegExp("^[0-9]{6,}$"); if(!reg.test(passwd)){ document.getElementById("passwd1").innerHTML="<font color=red size=2>密码至少为6位数字</font>"; }else{ document.getElementById("passwd1").innerHTML=""; } } function p_passwd1(){ var passwd=document.getElementById("password1").value; var passwd2=document.getElementById("password2").value; var reg=new RegExp("^[0-9]{6,}$"); if(!reg.test(passwd)){ document.getElementById("passwd2").innerHTML="<font color=red size=2>密码至少为6位数字</font>"; }else{ if(passwd!=passwd2){ document.getElementById("passwd2").innerHTML="<font color=red size=2>密码不一致</font>"; }else{ document.getElementById("passwd2").innerHTML=""; } } } function p_address(){ var passwd=document.getElementById("truename").value; var reg=/^[\一-\龥]{1,}$/; if(!reg.test(passwd)){ document.getElementById("true_name").innerHTML="<font color=red size=2>姓名不能为空,且为中文</font>"; }else{ document.getElementById("true_name").innerHTML=""; } } function p_address1(){ var address=document.getElementById("address").value; var reg=/^[\一-\龥]{2,}$/; if(!reg.test(address)){ document.getElementById("addressshow").innerHTML="<font color=red size=2>地址不能为空,且为中文</font>"; }else{ document.getElementById("addressshow").innerHTML=""; } } }