<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<head><title>注册</title>
<script type="text/javascript">
function aa(){
var psw = document.getElementsByName("psw")[0].value;
var psw1 = document.getElementsByName("psw1")[0].value;
if(psw!=psw1){
document.getElementById("cmp").style.visibility="visible";
}
else{
document.getElementById("cmp").style.visibility="hidden";
}
}
function check(){
var psw = document.getElementsByName("psw")[0].value;
var psw1 = document.getElementsByName("psw1")[0].value;
if(psw!=psw1){
alert("两次输入密码不一致,请重新输入")
return false;
}
return true;
}
</script>
<style type="text/css">
#cmp{
color:red;
font-size:11px;
visibility:hidden;
}
#bd{
width:380px;
height:580px
font-size:12px;
background:#EEE;
color:#000;
padding:20% 30%;
overflow:auto;
}
#form{
border:#bbb 1px solid;
background-color:#fff;
text-align:right;
padding:30px 80px 0px 0px;
width:480px;
outline:#F00 dashed 3px;
}
.input-text{
width:200px;
}
.block{
margin-top:10px;
}
#btn{
margin-top:25px;
text-align:center;
}
</style>
</head>
<body id="bd">
<div id="form">
<form action="./a.jsp" method="POST" οnsubmit="return check()">
<div class="block">用 户 名 :<input type="text" name="name" class="input-text"/></div>
<div class="block">密 码 :<input type="password" name="psw" class="input-text"/></div>
<div class="block">再次输入密码:<input type="password" name="psw1" class="input-text" οnblur="aa()"/></div>
<span id="cmp" >两次输入密码不一致,请重新输入</span>
<div class="block">绑定邮箱 :<input type="text" name="email" class="input-text" onFocus="aa()"/></div>
<div id="btn" class="block"><input type="submit" value="申请注册" /></div>
</form>
</div>
</body>
</html>