简单的注册程序

<%@ 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" οnsubmit="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="确定" οnclick="checkPassword">
<input type="reset" name="reset" value="取消">
</td>
</tr>
</table>
</form>
</body>
</html>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值