I have a form with checkboxes that were pulled through relational database using Spring Java. I need a way to figure out which checkbox did the user click and then get the delete button to work without putting the delete button inside the the form or loop.
Right now it's hardcoded.
<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>
Aucun commentaire:
Enregistrer un commentaire