Click here to Skip to main content
15,896,730 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

HTML
CheckboxSelectAll Projects
1Checkboxlist Project1
2Checkboxlist Project2
3Checkboxlist Project3
Posted

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
 
Share this answer
 
Comments
santoshkumar413 30-Oct-14 6:55am    
Events In CheckBox List are only serverside there is no client side events for chekbox list. Please if you have any relevant code please suggest me.
MukeshSagar 30-Oct-14 7:29am    
Use JQuery code to check the number of selected checked boxes
MukeshSagar 30-Oct-14 7:31am    
refer the link :
http://stackoverflow.com/questions/18181909/count-the-number-of-checkboxlist-and-if-checked-items-more-than-1-check-another
this might help you..
checkboxes in Gridview Header[^]
 
Share this answer
 
Comments
santoshkumar413 30-Oct-14 7:10am    
its not working for checkbox list. please suggest me any other.
 
Share this answer
 
Comments
santoshkumar413 30-Oct-14 7:34am    
Thank You Praveen I was looking solution of this kind
Praveen_P 30-Oct-14 7:38am    
you are welcome ..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900