如果选中所有复选框,如何选择主复选框 [英] How to select main checkbox if all checkboxes are checked

查看:139
本文介绍了如果选中所有复选框,如何选择主复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述







我有复选框列表和主复选框,如果我在复选框列表中手动选中所有复选框然后主要复选框自动需要使用javascript检查。



< asp:CheckBox ID =CheckBox1runat =serverAutoPostBack =TrueOnCheckedChanged = CheckBox1_CheckedChangedText =全选Visible =false/>



< asp:CheckBoxList ID =lbxProjectListrunat =server>





看起来像格式



 CheckboxSelectAll Projects 
1Checkboxlist Project1
2Checkboxlist Project2
3Checkboxlist Project3

解决方案

< blockquote>在这种情况下,您处理Checkboxlist的事件以检查是否所有项目都被选中,然后选择main复选框,否则取消选中main复选框


这可能对您有帮助..

Gridview标题中的检查框 [ ^ ]


Hi


查看以下链接



http://www.aspsnippets.com/Articles/Check-Uncheck-all-items-in-ASPNet-CheckBoxList-using-jQuery.aspx [ ^ ]



谢谢


Hi,


I have checkbox list and main check box, if i selects all the check boxes manually in checkbox list then main check box automatically need to be checked using javascript.

<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" Text="Select All" Visible="false" />

<asp:CheckBoxList ID="lbxProjectList" runat="server" >


Looks Like Below Format

CheckboxSelectAll Projects
1Checkboxlist Project1
2Checkboxlist Project2
3Checkboxlist Project3

解决方案

In this case you handle the event for the Checkboxlist to check if all the items are selected then select the main checkbox otherwise deselect the main checkbox


this might help you..
checkboxes in Gridview Header[^]


Hi
check the below link

http://www.aspsnippets.com/Articles/Check-Uncheck-all-items-in-ASPNet-CheckBoxList-using-jQuery.aspx[^]

Thanks


这篇关于如果选中所有复选框,如何选择主复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆