stuts2 做的列表怎么在添加了多选框之后实现删除按钮----菜鸟求职,虽然也看到一些解决方法,但是没看懂-
-菜鸟求职,虽然也看到一些解决方法,但是没看懂-
我在列表中添加了一列的复选框,不知道怎么获取,被选中行的id,并传到后台,然后执行删除操作。
下面是我写的代码,求各位大神帮着下我这个小菜鸟吧:
<script type="text/javascript">
deletBut = function(obj)
{
var formObj = document.getElementById("listId");
alert(formObj);
var tbody = document.getElementById("planContId");
tbody.deleteRow(1);
//--------------
for(var i=0;i<formObj.arrivedSXBerth.length;i++)
if(formObj.arrivedSXBerth[i].checked){
formObj.hidRowid=formName.hidRowid+formName.hidRid[i].value+"%";
}
}
//--------------
alert(tbody);
formObj.action = "deletePlan";
formObj.submit();
}
addXH = function()
{
var tbody = document.getElementById("planContId");
var length= tbody.childNodes.length;
alert(document.onselect);
for(var i = 0 ; i < length ; i++)
{
tbody.childNodes
}
}
</script>
</head>
<body bgcolor="#FFFFE0" >
<table bgcolor="#F7FAF9" border="1" align="center" cellpadding="0" cellspacing="0" width="80%">
<thead align="center" valign="middle" >
<tr >
<td align="center" colspan="6">计划列表</td>
</tr>
<tr>
<td colspan="6" align="left">
<form name = "form1" id="listId" action="MainAction">
<input type="submit" value="新增" name = "add" id="add"/>
<input type="button" onclick="deletBut();" value="删除" name = "delete" id="delete"/>
<input type="button" onclick="addXH();" value="修改" name = "edit" id="edit"/>
</form>
</td>
</tr>
</thead>
<tbody id="planContId" >
<tr>
<td>序号</td>
<td></td>