function seltAll(){  
    var chckBoxSign = document.getElementById("ckb");       //ckb 全选/反选的选择框id  
    var chckBox = document.getElementsByName("chckBox");    //所有的选择框其那么都是chckBox  
    var num = chckBox.length;  
    if(chckBoxSign.checked){  
        for(var index =0 ; index<num ; index++){  
            chckBox[index].checked = true;  
            }  
    }else{  
        for(var index =0 ; index<num ; index++){  
            chckBox[index].checked = false;  
            }  
        }  
    }  

function deleSeltedRecords(){  
    var chckBox = document.getElementsByName("chckBox");  
    var num = chckBox.length;  
    var ids = "";  
    for(var index =0 ; index<num ; index++){  
        if(chckBox[index].checked){  
            ids += chckBox[index].value + ",";                
        }  
    }  
    if(ids!=""){  
        if(window.confirm("确定删除所选记录?")){  
            $.ajax( {  
                type : "post",  
                url : '../servlet/UserController?oper=33&ids=' + ids, //要自行删除的action  
                dataType : 'json',  
                success : function(data) {  
                    alert("删除成功");  
                    window.location.href = "" ;  
                },  
                error : function(data) {  
                    alert("系统错误,删除失败");  
                }  
            });  
        }  
    }else{  
        alert("请选择要删除的记录");  
        }  
    } 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2021-10-07
  • 2022-12-23
相关资源
相似解决方案