码迷,mamicode.com
首页 > 其他好文 > 详细

前台页面获取checkbox值 例子

时间:2018-01-09 16:38:24      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:cto   fun   java   前台   conf   order   use   class   border   

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="mian_b_bg">
<tr>
<td width="3%" class="mian_b_bg_lm"><input name="" type="checkbox" value="">&nbsp;</td>
<td width="11%" class="mian_b_bg_lm"><span></span>排序ID</td>
<td width="15%" class="mian_b_bg_lm"><span></span>名称</td>
<td width="40%" class="mian_b_bg_lm"><span></span>电话</td>
<td width="40%" class="mian_b_bg_lm"><span></span>操作</td>
</tr>
<tr>
<td>
<c:forEach var="list" items="${userList}">
<tr>
<td><input name=id type="checkbox" value="${list.id}">&nbsp;</td>
<td>${list.id}</td>
<td>${list.useraccount}</td>
<td>${list.usermobile}</td>
<td width="8%" class="mian_b_icon_01"><a href="toUpdate.do?id=${list.id}">编辑</a></td>
</tr>
</c:forEach>
</td>
<td>
</tr>
</table>

 

 

<script type="text/javascript">

function del() {
var value = document.body.querySelectorAll("input[type=‘checkbox‘]");
for (var i = 0; i < value.length; i++) {
if (value[i].checked) {
var temp = value[i].value;
if (temp != null) {
if (confirm("确定要删除吗")) {

location.href = "delete.do?id=" + temp;

}
}

}
}

}
</script>

前台页面获取checkbox值 例子

标签:cto   fun   java   前台   conf   order   use   class   border   

原文地址:https://www.cnblogs.com/ll0405/p/8251432.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!