function checknm() {
var check = false;
var username = document.getElementsByName("username")[0];
if (1<=username.value.length && username.value.length<=10){
console.log(document.getElementById("checktext1").innerHTML = " √")
check = true;
}else{
document.getElementById("checktext1").innerHTML = " × 最多10位且不为空";
check = false;
}
return check;
}
function checkide(){
var check = false;
var userid = document.getElementsByName("userid")[0];
if (1<=userid.value.length && userid.value.length<=10){
document.getElementById("checktext2").innerHTML = " √";
check = true;
}else{
document.getElementById("checktext2").innerHTML = " × 最多10位且不为空";
check = false;
}
return check;
}
function checkpwd(){
var check = false;
var userpwd = document.getElementsByName("userpwd")[0];
if (6
document.getElementById("checktext3").innerHTML = " √";
check = true;
}else{
document.getElementById("checktext3").innerHTML = " × 最少6位,最多15位";
check = false;
}
return check;
}
function checkpwd1(){
var check = false;
var userpwd1 = document.getElementsByName("userpwd1")[0];
var userpwd = document.getElementsByName("userpwd")[0];
if (userpwd1.value == userpwd.value){
document.getElementById("checktext4").innerHTML = " √密码一致";
check = true;
}else{
document.getElementById("checktext4").innerHTML = " × 两次密码不一致";
check = false;
}
return check;
}
function checkeml(){
var check = false;
var useremail = document.getElementsByName("useremail")[0];
if (!/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/.test(useremail.value)){
document.getElementById("checktext5").innerHTML = " × 邮箱格式不规范";
check = false;
}else{
document.getElementById("checktext5").innerHTML = " √";
check = true;
}
return check;
}
function check(){
var check = checknm() && checkide() && checkpwd() && checkpwd1() && checkeml();
return check;
}
*用户名: | ||
*用户ID: | ||
*登录密码: | ||
*确认密码: | ||
*电子邮箱: | ||
重填 |