<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Untitled Document</title>
</head>
<body>
<select id="pro">
<option value="請選擇">請選擇==</option>
<option value="湖北省">湖北省==</option>
<option value="湖南省">湖南省==</option>
</select>
<select id="city">
<option>請選擇==</option>
</select>
<div id="ck" style="display: none;">
<input type="checkbox" id="RR" name="RR" value="男1 " >游泳
<input type="checkbox" name="RR" value="女1">打籃球
</div>
<div id="rd" style="display: none;">
<input type="radio" name="R" value="男 " checked="checked">國際米蘭
<input type="radio" name="R" value="女">AC米蘭
</div>
</body>
<script language="JavaScript">
document.getElementById("pro").onchange = function(){
if (this.value =="湖北省")
{
document.getElementById("rd").style.display = "block"; //顯示
document.getElementById("ck").style.display = "none"; //隱藏
}
else if(this.value =="湖南省")
{
document.getElementById("rd").style.display = "none"; //顯示
document.getElementById("ck").style.display = "block"; //隱藏
}
else if(this.value =="請選擇")
{
document.getElementById("rd").style.display = "none"; //顯示
document.getElementById("ck").style.display = "none"; //隱藏
}
}
</script>
</html>
<pre name="code" class="html">
</pre><pre name="code" class="html"><%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
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 'User-add.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">
-->
</head>
<body background="pic/13.jpg">
<form action="user-doadd" method="post" >
<table align="center" border="1">
<tr>
<td>
密碼
</td>
<td>
<input type="text" name="userdto.userpass">
</td>
</tr>
<tr>
<td>
註冊時間
</td>
<td>
<input type="text" name="userdto.usertime" value="${time}">
</td>
</tr>
<tr>
<td>
權限
</td>
<td>
<input type="text" name="userdto.quanxian">
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="確定">
<input type="reset" value="重置">
</td>
</tr>
</table>
</form>
</body>
</html>