js实现datagrid 模板列中有多个checkbox 时只许选中一个..........

 

 function change_check(temp)
         {
         
           
            
             
             
var checks= temp.parentElement.parentElement.getElementsByTagName("input");
               
for (i=0;i<checks.length-1;i++)
               {
                 
if (checks[i]!=temp &&checks[i].checked)
                 {
                 checks[i].checked
=!temp.checked ;
                 }
                  
               }
            
                
    
            
        
               
            
          
         }


<ItemTemplate>
                            
<asp:CheckBox id="User" Runat="server" onclick="change_check(this)"></asp:CheckBox>
                        
</ItemTemplate>
 

posted on 2005-07-25 16:51  gwazy  阅读(1655)  评论(0编辑  收藏  举报

导航