1.
<td width="5%" class=content><div align="center">全选<input type=checkbox name = "check" onclick = "javascript:allcheck();"></div></td>
2.
<td width=5%>
<div align="center">
<input type="checkbox" name="checkboxDelete"
value="<bean:write name="po" property="projectid" />">
</div>
</td>
js代码:
<script language="javascript">
var tag = false;
function doDelete()
{
if(deletecheck())
{
var theForm=document.projectSetForm;
theForm.action = "projectSet.do?do=delete&lotId=<%=request.getParameter("lotId") %>";
theForm.submit();
}
}
function deletecheck()
{
var theForm = document.projectSetForm;
var checked = false;
if(typeof(theForm.checkboxDelete.length)=="undefined"){
if(theForm.checkboxDelete.checked == true){
checked = true;
}
}else{
var len = theForm.checkboxDelete.length;
for (var i=0;i<len;i++){
if(theForm.checkboxDelete[i].checked == true){
checked = true;
break;
}
}
}
if(!checked){
alert("请至少选择一条要删除的记录!")
return(false);
}
if(confirm("确定要删除吗?")){
return(true);
}
return(false);
}
function allcheck(){
var theForm = document.projectSetForm;
var len = theForm.checkboxDelete.length;
var i = 0
if (tag == false)
for (i=0;i<len;i++){
theForm.checkboxDelete[i].checked = true;
tag = true;
}
else{
for ( i=0;i<len;i++){
theForm.checkboxDelete[i].checked = false;
tag = false;
}
}
}
</script>