多选框单个点击事件

代码:

  $("ButtodId").live("click",function(){

     if($("input[name='checkName']:checked").length<1){

          alert("请先选择一条数据");//复选框未选中数据

     }

     

    if($("input[name='checkName']:checked").length>1){

          alert("每次只能选择一条数据");//复选框选中多条数据

     }

 

     var shujuId = $("input[name='checkName']:checked").val();//取数据对应的数据Id

 

     if(shujuId == null || shujuId ==""){

        alert("当前选中的数据不存在,请联系管理员");

    }else{

         window.showModalDialog("URL",null,"dialogWidth=600px;dialogHeight=500px;");//打开的新页面

     }

  });

posted @ 2016-11-07 09:48  懒得像猪  阅读(1568)  评论(0编辑  收藏  举报