所以我不確定如何標記這一個,但基本上我有一個動態加載的HTML表,其中包含可以刪除的值,目前我正在使用用戶的複選框決定刪除哪一行。這是我到目前爲止的代碼:幫助從HTML表中刪除字段
<table id="comments" align="center" width="59%">
<thead>
<th class="headerClass" width="7%">Delete</th>
<th width="15%" class="headerClass">Date</th>
<th class="headerClass" width="15%">Employee</th>
<th class="headerClass">Comment</th>
</thead>
<tbody>
<%
while (result.next()) {
commentDate = StringUtils.defaultString(result.getString("commentDate"));
commentUser = StringUtils.defaultString(result.getString("cName"));
comment = StringUtils.defaultString(result.getString("xbs_comment"));
%>
<tr>
<td class="normal"><input type="checkbox" class="checkbox" /></td>
<td class="normal"><%=commentDate%></td>
<td class="normal"><%=commentUser%></td>
<td class="normal" width="68%"><%=comment%></td>
</tr>
</tbody>
</table>
<label for="comment"><h4>Add a Comment:</h4></label>
<textarea cols="105" id="comment" name="comment" rows="4"></textarea>
<br />
<div align="center" class="submit">
<input class="submit" width="10%" type="submit" name="submit" id="submit" value="Submit" />
</div>
基本上我有意見表中,用戶可以使用提交按鈕添加評論,但我想他們也可以使用支票框刪除評論。我是否需要另一個帶有刪除按鈕的表格標籤,或者我可以只使用這一個提交按鈕?另外,如果我確實留在複選框中,我怎麼讓我的程序(函數和servlet)的後端知道哪些被檢查?謝謝你的幫助!!
我添加了jsp和java標籤,所以在這裏有專業知識的人會看到這些,並可以幫助你。我知道這些標籤需要解決您的問題。 – ace 2011-04-30 08:48:39