实现上图中的如下功能:如果 是否成员项未选中  能否发送项 不可用  否则 可用
<TABLE border="1" cellpadding="0" cellspacing="0"  bordercolor="lightGray"> 
<asp:Repeater id="Repeater" runat="server">
<HeaderTemplate>
<TR bgcolor="#9db8e8">
<TD>群组名称
</TD>
<TD>是否成员
</TD>
<TD>能否发送
</TD>
</TR>
</HeaderTemplate>
<ItemTemplate>
<TR>
<TD>
<asp:Label id=lblname runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"name")%>'>
</asp:Label>
<asp:Label id=lblId runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"id")%>' Visible="False">
</asp:Label></TD>
<TD>
<input type="checkbox" id="ckUsed" name="ckUsed" runat="server" onclick="javascript:ckUserClick()" />
</TD>
<TD>
<input type="checkbox" id="ckSend" name="ckSend" runat="server" disabled="false" />
</TD>
</TR>
</ItemTemplate>
</asp:Repeater></TABLE>

解决方案 »

  1.   

    $(":checkbox[name='ckUsed']").change(function(){
    if($(":checkbox[name='ckUsed']:checked").length==0)
    $(":checkbox[name='ckSend']").attr("disabled",true);
    else
    $(":checkbox[name='ckSend']").attr("disabled",false);
    });
      

  2.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>    <script language="javascript" type="text/javascript" src="../script/jquery-1.7.min.js"></script>    <style type="text/css">
            </style>    <script language="javascript" type="text/javascript">
        $(function(){
            $(":checkbox[name='ckSend']").attr("disabled",true);
            
            $(":checkbox[name='ckUsed']").change(function(){
                if(this.checked==true){
                    $(":checkbox[name='ckSend']",this.parentNode.parentNode).attr("disabled",false);
                }else{
                    $(":checkbox[name='ckSend']",this.parentNode.parentNode).attr("disabled",true);
                }
            });
        });
        
        
        </script></head>
    <body>
        <table>
            <tr>
                <th>
                    群组名称
                </th>
                <th>
                    是否成员
                </th>
                <th>
                    能否发送
                </th>
            </tr>
            <tr>
                <td>
                    全部
                </td>
                <td>
                    <input type="checkbox" name="ckUsed" />
                </td>
                <td>
                    <input type="checkbox" name="ckSend" />
                </td>
            </tr>
            <tr>
                <td>
                    内部
                </td>
                <td>
                    <input type="checkbox" name="ckUsed" />
                </td>
                <td>
                    <input type="checkbox" name="ckSend" />
                </td>
            </tr>
            <tr>
                <td>
                    测试
                </td>
                <td>
                    <input type="checkbox" name="ckUsed" />
                </td>
                <td>
                    <input type="checkbox" name="ckSend" />
                </td>
            </tr>
        </table>
    </body>
    </html>
    兄弟 以后问问题 问清楚
      

  3.   

    动态页面 执行时的代码<TABLE border="1" cellpadding="0" cellspacing="0"  bordercolor="lightGray">  <TR bgcolor="#9db8e8"> <TD>群组名称 </TD> <TD>是否成员 </TD> <TD>能否发送 </TD> </TR> <TR> <TD> <span id="Repeater__ctl1_lblname">全部</span> </TD> <TD> <input name="Repeater:_ctl1:ckUsed" id="Repeater__ctl1_ckUsed" type="checkbox" onclick="" /> </TD> <TD> <input name="Repeater:_ctl1:ckSend" id="Repeater__ctl1_ckSend" type="checkbox" /> </TD> </TR> <TR> <TD> <span id="Repeater__ctl2_lblname">内部</span> </TD> <TD> <input name="Repeater:_ctl2:ckUsed" id="Repeater__ctl2_ckUsed" type="checkbox" onclick="" /> </TD> <TD> <input name="Repeater:_ctl2:ckSend" id="Repeater__ctl2_ckSend" type="checkbox" /> </TD> </TR> <TR> <TD> <span id="Repeater__ctl3_lblname">测试组</span> </TD> <TD> <input name="Repeater:_ctl3:ckUsed" id="Repeater__ctl3_ckUsed" type="checkbox" onclick="" /> </TD> <TD> <input name="Repeater:_ctl3:ckSend" id="Repeater__ctl3_ckSend" type="checkbox" /> </TD> </TR> </TABLE>
      

  4.   

    兄弟 你的checkbox name是Repeater:_ctl3:ckUsed
    你改一下试试
      

  5.   

    $(function(){
            $(":checkbox[name='Repeater:_ctl3:ckSend']").attr("disabled",true);
            
            $(":checkbox[name='Repeater:_ctl3:ckUsed']").change(function(){
                if(this.checked==true){
                    $(":checkbox[name='Repeater:_ctl3:ckSend']",this.parentNode.parentNode).attr("disabled",false);
                }else{
                    $(":checkbox[name='Repeater:_ctl3:ckSend']",this.parentNode.parentNode).attr("disabled",true);
                }
            });
        });
      

  6.   

    你说的是多列?只有第一列选中时这一行的checkbox才都可用?是这意思的话把同name取一样就行了
      

  7.   

    给第一列的checkbox加个onchange事件,
    如果触发事件的这个checkbox选中,把这个checkbox所在的tr中name='Repeater:_ctl3:ckSend'的所有checkbox可用,如果未选中,同理,不可用