【发布时间】:2015-07-01 12:06:24
【问题描述】:
我有一个带有复选框的表单,这些复选框是使用 Spring Java 通过关系数据库提取的。我需要一种方法来确定用户单击了哪个复选框,然后让删除按钮工作,而无需将删除按钮放在表单或循环中。
现在它是硬编码的。
<form:form action="addStudent" method="POST" modelAttribute="student"class="form-horizontal" role="form">
<table style="width:100%">
<c:forEach var="thisStudent" items="${studentList}">
<tr>
<!-- <td><form:radiobutton path="studentID" value="${thisStudent.studentID}"/></td> -->
<td><form:checkbox path="studentID" value="${thisStudent.studentID}"/></td>
<td>${thisStudent.lastName}, ${thisStudent.firstName}</td>
</tr>
</c:forEach>
</table>
</form:form>
<a href="/removestudent?studentID=2" id="listItem">Remove Child</a>
【问题讨论】:
标签: java spring forms checkbox jstl