js:
<script type="text/javascript">
$(function(){$("#deleteBtn").click(function(){
//需要将选中的ids拼接提交
var arr_v = new Array();
$("input[type='checkbox']:checked").each(function(){
arr_v.push($(this).val());
});
var ids = arr_v.join(',');
window.location.href = "${pageContext.request.contextPath}/item/deleteitem.action?ids="+ids;
});
});
</script>
html:
<c:forEach items="${itemList }" var="item">
<tr>
<td><input type="checkbox" name="ids" value="${item.id }"/></td>
<td>${item.name }</td>
<td>${item.price }</td>
<td><fmt:formatDate value="${item.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${item.detail }</td>
<td><a href="${pageContext.request.contextPath }/itemEdit.action?id=${item.id}">修改</a></td>
</tr>
</c:forEach>