Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a check box and checkboxlist as
HTML
<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
Updated 1-May-12 1:03am
v2
Comments
Sandeep Mewara 1-May-12 8:43am    
What have you tried so far? Where are you stuck?

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 .... :)
Seshu
 
Share this answer
 
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[^]
 
Share this answer
 

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