<html>
<table>
<tr>
<c:forEach items="${currentOrderedUser}" var="msg" >
<td>
<input type="checkbox" name="id" value="${msg.id}">
</td>
<td>
<input type="text" name="price" value="${msg.price}">
</td>
<td>
<input type="text" name="productName" value="${msg.productName}">
</td>
</tr>
</c:forEach>
<input type="submit" value="提交">
</table>
</html>
当用户单击"提交“按钮时,验证表单,如果用户未选中任何一个复选框(id),则提示用户至少选中一个,如果用户选中了一个复选框,则对选中该行的productName,infoProduct,price进行验证,使之不能为空
<table>
<tr>
<c:forEach items="${currentOrderedUser}" var="msg" >
<td>
<input type="checkbox" name="id" value="${msg.id}">
</td>
<td>
<input type="text" name="price" value="${msg.price}">
</td>
<td>
<input type="text" name="productName" value="${msg.productName}">
</td>
</tr>
</c:forEach>
<input type="submit" value="提交">
</table>
</html>
当用户单击"提交“按钮时,验证表单,如果用户未选中任何一个复选框(id),则提示用户至少选中一个,如果用户选中了一个复选框,则对选中该行的productName,infoProduct,price进行验证,使之不能为空
可不要小看这个问题哟,还是有点难度的