您的位置:首页 > 其它

简单的注册程序

2013-03-19 12:14 211 查看
<%@ page language="java" contentType="text/html"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body bgcolor="green">
<script type="text/javascript">
function checkPassword(){
if(document.form.password.value.length==0){
alert("请输入密码");
return false;
}
if(document.form.cpassword.value.length==0){
alert("请输入确认密码");
return false;
}
if(document.form.password.value!=document.form.cpassword.value){
alert("两次输入密码不一致");
return false;
}
return true;
}
</script>
<%
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
%>
<h1 align="center"><b>欢迎注册</b></h1>
<form action="UserAction" method="post" name="form" align="center" onsubmit="return checkPassword()" >
<table align="center">
<tr>
<td align="center">
用户名:<input type="text"  name="username">
</td>
</tr>
<tr>
<td align="center">
密   码:<input type="password" name="password">
</td>
</tr>
<tr>
<td align="center">
确认密码:<input type="password" name="cpassword">
</td>
</tr>
<tr>
<td>
性别:<input type="radio" name="sex" value="男" checked>男
<input type="radio" name="sex" value="女">女
</td>
</tr>
<tr>
<td>学历:
<select name="xueli">
<option>高中</option>
<option selected>本科</option>
<option>大专</option>
<option>初中</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="submit" name="submit" value="确定" onclick="checkPassword">
<input type="reset" name="reset" value="取消">
</td>
</tr>
</table>
</form>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: