所有单选按钮组都是单击或不单击

时间:2011-07-11 11:50:10

标签: .net asp.net radiobuttonlist

在ascx用户控件中,有一个radiobuttonlist控件:

<asp:RadioButtonList ID="TrueFalse" runat="server" onclick="Radcheck();" 
                     Font-Bold="True"  RepeatDirection="Horizontal">
    <asp:ListItem Value="0">T</asp:ListItem> 
    <asp:ListItem Value="1">F</asp:ListItem>
</asp:RadioButtonList>

在javascript中,我想检查是否已检查所有radiobuttonlist控件。  它将由一个aspx页面调用,该页面将具有多个radiobuttonlist控件。 请找到解决方案。

1 个答案:

答案 0 :(得分:0)

function Radcheck(){
  var areAllChecked = true;
  $('#<%=this.TrueFalse.CLientID%> :radio').each(function(){
     if(!this.checked){
       areAllChecked = false;
       return ;
     }

  });

  return areAllChecked;

}