【发布时间】:2014-08-11 01:54:22
【问题描述】:
这是我的代码:
<table border="2">
<tr>
<th>CourseID</th>
<th>SectionNo</th>
<th>Add Info</th>
</tr>
<% while(rs.next()){ %>
<tr>
<FORM NAME="actionForm" action="ProfCourseUpdate" method='post'>
<td> <%=rs.getString("CourseID") %> </td>
<td> <%=rs.getInt("SectionNo") %> </td>
<td> <input type="submit" name="ProfCourseUpdate" value="Update Course Info"></td>
</FORM>
</tr>
<% } %>
</table>
我正在从数据库中提取信息并将它们放入表中各自的列中。 所以它看起来像: |课程---部分---(按钮)|
当我让用户单击提交按钮时,我希望能够传递整行的数据。我试过用这种方式隐藏输入:
<td> <%=rs.getString("CourseID") %> </td><td><input type="hidden" name="Course" value="<%rs.getString("CourseID") %>"></td>
它只会导致一些奇怪的表格格式并且不起作用。
【问题讨论】: