【JSP开源代码栏目提醒】:本文主要为网学会员提供addVote.jsp,希望对需要addVote.jsp网友有所帮助,学习一下!
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%if (session.getAttribute("userName") == null) {
response.sendRedirect("/Vote/admin/login.jsp");
}%>
<%//浠巉orm1琛ㄥ崟閫夐」涓暟涓幏鍙杗鍊硷紝濡傛灉娌℃湁灏辩粰涓涓粯璁ゅ?
String n = request.getParameter("n");
if (n == null) {
n = "4";
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>娣诲姞鎶曠エ椤圭洰</title>
<link rel="stylesheet" type="text/css" href="STYLE.CSS">
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0"
cellspacing="1" bgcolor="#000000">
<tr>
<td width="" height="30" bgcolor="#F0F0F0">
<table width="100%" border="0">
<tr>
<td width="300"> >>娣诲姞鎶曠エ</td>
<td width="200"><a href="/Vote/admin/index.jsp">棣栭〉</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="746" height="349" bgcolor="#F0F0F0">
<form method="POST" action="/Vote/AddVoteServlet" name="form1">
<table width="70%" height="224" border="0" align="center"
cellpadding="0" cellspacing="1" bgcolor="#999999">
<tr>
<td width="100%" height="18" bgcolor="#F0F0F0"></td>
</tr>
<tr>
<td height="25" bgcolor="#F0F0F0">閫夐」涓暟锛?<input type="text" name="n"
size="6" onchange="location.href='addVote.jsp?n='+form1.n.value;"
value="<%=n%>"> <!?-杩噊nchange鏂规硶瀹炵幇鏀瑰彉閫夐」涓暟鍊硷紝骞朵紶缁欎笂闈㈢殑鍙橀噺n锛屼粠鑰屽姩鎬佸湴鏀瑰彉閫夐」涓暟-->
<input type="button" value="纭?瀹? name="B3"></td>
</tr>
<tr>
<td height="25" bgcolor="#F0F0F0">涓婚锛?<input type="text"
name="title" size="38"></td>
</tr>
<tr>
<td height="25" bgcolor="#F0F0F0">鏂瑰紡锛?<input type="radio"
value="radio" name="style" checked>鍗曢?nbsp; <input type="radio"
value="checkbox" name="style">澶氶?/td>
</tr>
<tr>
<td height="25" bgcolor="#F0F0F0">寮濮嬫椂闂达細 <select size="1"
name="startyear">
<option value="2005" selected>2005</option>
<%for (int i = 6; i < 10; i++) {
out.println("<option value=200" + i + ">200" + i + "</option>");
}
%>
</select>骞?select size="1" name="startmonth">
<option value="1" selected>1</option>
<%for (int i = 2; i < 13; i++) {
out.println("<option value=" + i + ">" + i + "</option>");
}
%>
</select>鏈?select size="1" name="startday">
<option value="1" selected>1</option>
<%for (int i = 2; i < 32; i++) {
out.println("<option value=" + i + ">" + i + "</option>");
}
%>
</select>鏃?nbsp; </td>
</tr>
<tr>
<td height="25" bgcolor="#F0F0F0">缁撴潫鏃堕棿锛?<select size="1"
name="endyear">
<option value="2005" selected>2005</option>
<%for (int i = 6; i < 10; i++) {
out.println("<option value=200" + i + ">200" + i + "</option>");
}
%>
</select>骞?select size="1" name="endmonth">
<option value="1" selected>1</option>
<%for (int i = 2; i < 13; i++) {
out.println("<option value=" + i + ">" + i + "</option>");
}
%>
</select>鏈?select size="1" name="endday">
<option value="1" selected>1</option>
<%for (int i = 2; i < 32; i++) {
out.println("<option value=" + i + ">" + i + "</option>");
}
%>
</select>鏃?nbsp; </td>
</tr>
<%//鏍规嵁n鍊煎垪鍑洪夐」
for (int i = 1; i <= Integer.parseInt(n); i++) {
%>
<tr>
<td height="25" bgcolor="#F0F0F0">閫夐」<%=i%>锛?input type="text"
name="option<%=i%>" value=""></td>
</tr>
<%}
%>
<tr>
<td height="25" bgcolor="#F0F0F0">璁句负褰撳墠璋冩煡椤圭洰锛?<input type="radio"
name="active" value="1" checked>鏄?<input name="active" type="radio"
value="0">鍚?/td>
</tr>
<tr>
<td height="25" align="center" bgcolor="#F0F0F0"><input
type="submit" value="鎻愪氦" name="B1"> <input
type="reset" value="鍙栨秷" name="B2"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>