Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: jQuery checkbox struts
I have a check box and checkboxlist as
<s:checkbox name="modProcessVO.byWeeklyCal" id="week">Days of the Week</s:checkbox>
<br><br>
<s:checkboxlist list="{'Mon','Tue','Wed','Thur','fri','Sat','Sun'}" name="modProcessVO.weeklyCal" id="days"/>
 
So initially all checkboxes for the list should be diabled and when i check the checkbox for 'Days of the Week', the checkboxlist for the 7 days should be enabled. Pls help me on this
Posted 1-May-12 0:53am
Edited 1-May-12 1:03am
v2
Comments
Sandeep Mewara at 1-May-12 8:43am
   
What have you tried so far? Where are you stuck?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

hi johny
 
try this

// First way
$('#week').attr('checked');
 
// Second way
$('#week').is(':checked');
 

then enable or disable the checkbox list using id
 

Happy coding .... Smile | :)
Seshu
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Try following:
 
if ($('#weekCheckBox').is(':checked')){
$("[id*=CheckBoxList1] input:checkbox").prop('checked', true);
}
 

For more information to set checkboxlist items in jquery, check following:
 
ASP.NET CheckBoxList Operations with jQuery[^]
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 9,108
1 OriginalGriff 8,186
2 CPallini 2,613
3 Richard MacCutchan 2,231
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 15 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100