日期:2014-05-16 浏览次数:20426 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录</title>
<link href="style/style2.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
//检查邮箱
function checkemail(){
var myemail=document.getElementById("eml").value;
var mesg_error= document.getElementById("emai_error");
if(myemail!="")
{//查找@,如果没有就返回-1
if(myemail.indexOf("@")==-1||myemail.indexOf(".")==-1||(myemail.indexOf("@")>myemail.indexOf(".")))
{
//mesg_error.innerHTML="<font color='red'></font>";
alert("email格式不正确!例:xiaoniu@qq.com");
document.getElementById("eml").focus();
return false;
}
else
{
mesg_error.innerHTML="<font color='red'>√</font>";
return true;
}
}
else
{
alert("email不能为空!")
//mesg_error.innerHTML="<font color='red'>email不能为空!</font>";
document.getElementById("eml").focus();
return false;
}
}
//检查密码
function checkpwd()
{
var mypwd=document.getElementById("pwd").value;
var pwd_error=document.getElementById("pwd_error");
if(mypwd=="")
{
//pwd_error.innerHTML="<font color='red'>密码不能为空!</font>";
alert("密码不能为空");
return false;
}
else if(mypwd.length>=6&&mypwd.length<=16)
{
pwd_error.innerHTML="<font color='red'>√</font>";
return true;
}
else
{
//pwd_error.innerHTML="<font color='red'>密码至少应为6位到16位!</font>";
alert("密码至少应为6位到16位!");
return false;
}
}
//检查确认密码
function checkpwdd()
{
var mypwdd=document.getElementById("pwdd").value;
var pwdd_error=document.getElementById("pwdd_error");
if(mypwdd=="")
{
//pwdd_error.innerHTML="<font color='red'>确认密码不能为空!</font>";
alert("确认密码不能为空!");
return false;
}
else if(document.getElementById("pwdd").value!=document.getElementById("pwd").value)
{
//pwdd_error.innerHTML="<font color='red'>确认密码与密码不一致!</font>";
alert("确认密码与密码不一致!");
return false;
}
else
{
pwdd_error.innerHTML="<font color='red'>√</font>";
return true;
}
}
//检查提交
function regist()
{
var email_err=document.getElementById('emai_error').innerHTML;
var pwd_err=document.getElementById('pwd_error').innerHTML;
var pwdd_err=document.getElementById('pwdd_error').innerHTML;
var yx=document.getElementById("eml").value