根据选择的复选框先显示在表格中再修改数据

java中根据选择的复选框先显示在表格中再修改数据, function update(){

    var count=0;
        var i=0;
        var box=document.getElementsByName("checkbox2");
        for(var j=0;j<box.length;j++){
            if(box[j].checked==true){
                i=j;
                count++;
            }
            alert(box.length);
            alert(count);
            if(count==0){
                alert("请选择!");
                return;
            }
            if(count>0){
                window.location="${pageContext.request.contextPath}/servlet/AdminInfoServlet?type=update&id="+box[i].value;
            }
        }
    }
我只写了这么多,实现不了