<%@ page language="java" contentType="text/html;charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>注册</title>
<style type="text/css">
h1{
font-family: "Alex Brush";
font-size:55px;
color:lightpink;
}
body{
background-image:url("image/blue.JPG");
background-size:cover;
}
input{
background-color: antiquewhite;
border-radius: 10px;
border-color: antiquewhite;
}
</style>
</head>
<body>
<form action="RegisterServlet" method="post">
<div align="center">
<br><br><br><br><br>
<h1>Register</h1>
用户名: <input type="text" size="20px" value="" name="username"/><br><br>
密 码: <input type="password" id="pw" size="20px" value="" name="password"/><br><br>
确认密码:<input name="repassword" id="repw" type="password" class="kuang_txt possword" size="20px" onkeyup="checkpassword()"><br>
<span id="tishi"></span></input>
<br>
<input type="submit" size="5px" value="注册" name="submit">
</div>
</form>
<script type="text/javascript">
function checkpassword() {
var password = document.getElementById("pw").value;
var repassword = document.getElementById("repw").value;
if(password == repassword) {
document.getElementById("tishi").innerHTML="<br><font color='green'>两次密码输入一致</font>";
document.getElementById("submit").disabled = false;
}else{
document.getElementById("tishi").innerHTML="<br><font color='red'>两次输入密码不一致!</font>";
document.getElementById("submit").disabled = true;
}
}
</script>
</body>
</html>