87,990
社区成员
发帖
与我相关
我的任务
分享
<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>
$(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);
}
});
});
<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>
<!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>
兄弟 以后问问题 问清楚$(":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);
});