关闭

js实现checkbox批量增加和删除

50人阅读 评论(0) 收藏 举报

.//判断checkbox是否选择  
        function checkSelect(obj,name)  
        {  
           var count = 0;  
           //var checkId = new Array;  
           var form = document.getElementsByTagName("input");  
           for(var i=0; i<form.length; i++)  
            {  
               if (form[i].type=="checkbox"&&form[i].checked&&form[i].name == name )  
                {  
                    ++count;  
                }  
            }     
     
            if(count==0){  
                alert("请选择要处理服装!");  
            }  
            else{  
                if(obj.value == "上架"){  
                    if(confirm("确定要上架这"+count+"件服装吗?")){  
                            with(document.getElementById("form11")){  
                                method="post";  
                                action="clothingStock_saleClothing.action";  
                                submit();                                             
                            }  
                    }  
                }  
                if(obj.value == "删除"){  
                    if(confirm("确定要删除这"+count+"件服装吗?")){  
                        with(document.getElementById("form11")){  
                            method="post";  
                            action="clothingStock_deleteClothing.action";  
                            submit();                                             
                       }  
                    }  
                }  
            }  
        } 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:526次
    • 积分:23
    • 等级:
    • 排名:千里之外
    • 原创:2篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条
    文章存档