<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'JiaoYan.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function check(fom){
if (fom.user.value=="") {
alert("用户名不能为空!");
fom.user.focus();
return false;
}
if (fom.psw.value=="") {
alert("密码不能能够为空!");
fom.psw.focus();
return false;
}
if (fom.psw2.value!=fom.psw.value) {
alert("两次输入的密码不一致!请重新输入!");
fom.psw.focus();
return false;
}
if (fom.email.value=="") {
alert("邮箱不能为空!");
fom.email.focus();
return false;
}
if (fom.email2.value!=fom.email.value) {
alert("两次输入的邮箱地址不一致!请重新输入!");
fom.email.focus();
return false;
}
}
</script>
</head>
<body>
<form action="" name="fom" method="post" οnsubmit="return check(this)">
<p align="center">用户注册</p>
<p align="center">用户名:<input type="text" name="user">
</p>
<p align="center">密码:<input type="password" name="psw">
</p>
<p align="center">确认密码:<input type="password" name="psw2">
</p>
<p align="center">输入邮箱:<input type="text" name="email">
</p>
<p align="center">确认邮箱:<input type="text" name="email2">
</p>
<p align="center"><input type="submit" value="提交">
<input type="reset" value="重置">
</p>
</form>
</body>
</html>