客户端全部选中或取消DataGrid中的CheckBox

<script>
        
// 全选 
        function allCheck() 
        

            
for (var i=0;i<Form1.elements.length;i++
            

                
var e=Form1.elements[i]; 
                
if (e.type=='checkbox') 
                e.checked
=true
            }
 

        }
 
        
//反选 
        function revCheck() 
        

            
for (var i=0;i<Form1.elements.length;i++
            

            
var e=Form1.elements[i]; 
            
if (e.type=='checkbox') 
            e.checked
= false;
            }
 
        }
 
        
        
function CheckBoxSelect()
        
{
           
var cb=document.getElementById("cbAll");
           
if(cb.checked)
           
{
              allCheck();
           }

           
else
           
{
             revCheck();
           }

        }

        
</script>
posted @ 2007-03-27 11:34  Kangaroo  阅读(357)  评论(0编辑  收藏  举报