⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edit1.jsp

📁 数据库表结构 用SQL Server建立数据库 数据库名:questionnaire Questions表 QuestionID 索引投票主题 Questions 存储投票主题内容
💻 JSP
字号:
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<%@page contentType="text/html;charset=GB2312"%>
<%@include file="opendata.jsp"%>
<%@include file="convert.jsp"%>
<%@include file="check.jsp"%>

<html>
<head>
<title>
编辑问题及选项
</title>
<LINK href="style.css" rel=stylesheet>
<body>
<center>
为了保证投票的公正性,请先将计数器清零后修改选项!
</center>
<hr>
<form action=modify.jsp method=post>
<DIV align=center>
 <TABLE cellSpacing=0 cellPadding=0 width=73% align=center border=0 bordercolor="#999999">
  <tr>
   <td bgcolor=#999999>调查主题:</td>
<%
 request.getSession(true);
 session.putValue("questionid",String.valueOf(request.getParameter("questionid")));

 int questionid;
 questionid = Integer.parseInt(request.getParameter("questionid"));
 out.print("<a href=resetcount.jsp?questionid="+questionid+"><font color=red>将本主题投票记数全部清0</font></a>");
 sql = "select Question from Questions where QuestionID='"+questionid+"'";
 rs = smt.executeQuery(sql);
 String question = null;
 while(rs.next())
 {
   question = rs.getString(1);
 // question = Replace(question);
 }
 %>
 <td align=right><input class=smallInput type=text size=90 name=question value = "<%=question%>"</td>
 <%sql = "select Item from Items where QuestionID='"+questionid+"'";
 rs = smt.executeQuery(sql);
 String item = null;
 int i= 0;
 while(rs.next())
 {
   item = rs.getString(1);
   i++;
   out.print("<tr><td>选项"+i+":</td>");
 %>
   <td align=right><input class=smallInput type=text size=90 name=item<%=String.valueOf(i)%> value="<%=item%>"></td></tr>
 <%}

 for(;i<10;++i)
 {
    out.print("<tr><td>选项"+(i+1)+":</td>");
    out.print("<td align=right><input class=smallInput type=text size=90  name=item"+String.valueOf(i+1)+" ></td></tr>");   
 }

%>
  <tr><td>

  </tr>
</table>
</DIV>
<p>
<DIV align=center><INPUT class=buttonface type=submit value=发布 name=Submit>
<INPUT class=buttonface type=reset value=重写 name=Submit2></DIV>
</form>

<hr>
<div align="center"><a href = mainform.jsp>回问卷管理页面</a></div>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -