nameEmpty = false;
if(pattern.test(inputName)){ //包含特殊字符
document.getElementById(“name-errMsg”).innerHTML = “用户名格式错误,不能包含特殊字符!”
document.getElementById(“name-input”).style = “border:2px solid red;”
nameEnable = false;
}else{
document.getElementById(“name-errMsg”).innerHTML = " "
document.getElementById(“name-input”).style = “border:0px;”
nameEnable = true;
}
}else{
nameEmpty = true;
}
}
//检查密码,
function checkPwd1(){
var inputPwd_1 = document.getElementById(“pwd-input1”).value;
var inputPwd_2 = document.getElementById(“pwd-input2”).value;
if(!CheckEmpty(inputPwd_1) && !CheckEmpty(inputPwd_2)){
pwd1Empty = false;
pwd2Empty = false;
if(inputPwd_1 != inputPwd_2){
document.getElementById(“pwd-errMsg2”).innerHTML = “两次密码不相同,请检查!”;
document.getElementById(“pwd-input1”).style = “border:2px solid red;”
document.getElementById(“pwd-input2”).style = “border:2px solid red;”
pwdEnable = false;
}
if(inputPwd_1 == inputPwd_2){
document.getElementById(“pwd-errMsg2”).innerHTML = " ";
document.getElementById(“pwd-input1”).style = “border:0px;”
document.getElementById(“pwd-input2”).style = “border:0px;”
pwdEnable = true;
}
}else if(!CheckEmpty(inputPwd_1) && CheckEmpty(inputPwd_2)){
pwd1Empty = false;
pwd2Empty = true;
}else if(CheckEmpty(inputPwd_1) && !CheckEmpty(inputPwd_2)){
pwd1Empty = true;
pwd2Empty = false;
}else{
pwd1Empty = true;
pwd2Empty = true;
}
}
//检查重复密码,是否相同
function checkPwd2(){
var inputPwd_1 = document.getElementById(“pwd-input1”).value;
var inputPwd_2 = document.getElementById(“pwd-input2”).value;
if(!CheckEmpty(inputPwd_1) && !CheckEmpty(inputPwd_2)){
pwd1Empty = false;
pwd2Empty = false;
if(inputPwd_1 != inputPwd_2){
document.getElementById(“pwd-errMsg2”).innerHTML = “两次密码不相同,请检查!”;
document.getElementById(“pwd-input1”).style = “border:2px solid red;”
document.getElementById(“pwd-input2”).style = “border:2px solid red;”
pwdEnable