81,114
社区成员
发帖
与我相关
我的任务
分享
可以用表单,也可以不用
window.location = "http://www.baidu.com?checkbox=" + titles;
是可以跳转的,可能是你的路径不对。
用表单也可以。
function del(form)
{
if(confirm("您确信要删除吗?"){
var count = 0;
var titels= "";
var topicTitles = document.getElementByNames("checkbox");
for (var i = 0; i < topicTitles.length; i++) {
if (topicTitles[i].checked) {
titels+= topicTitles[i].value + ",";
count ++;
}
}
if (count <= 0) {
alert("至少要选择一条数据");
return;
}
window.location="del.jsp?checkbox="+titels;
}
}
就这样就能获得你选中的checkBox的值了,到后台用“,”分割就一个一个的值了
function del(form)
{
if(confirm("您确信要删除吗?"){
var count = 0;
var titels= "";
var topicTitles = document.getElementsByName("checkbox");
for (var i = 0; i < topicTitles.length; i++) {
if (topicTitles[i].checked) {
titels+= topicTitles[i].value + ",";
count ++;
}
}
if (count <= 0) {
alert("至少要选择一条数据");
return;
}
window.location="del.jsp?checkbox="+titels;
}
}
就这样就能获得你选中的checkBox的值了,到后台用“,”分割就一个一个的值了