<asp:CheckBoxList ID="chkList" runat="server" Enabled="false" >
<asp:ListItem Text="1" Value="1"></asp:ListItem>
<asp:ListItem Text="2" Value="2"></asp:ListItem>
</asp:CheckBoxList>
<asp:Button ID="btnFoo" runat="server" Text="Test" />
<script type="text/javascript" language="javascript">
$(document).ready(function () {
$('#<% = btnFoo.ClientID %>').click(function () {
//var targetValue = 2;
var items = $('#<% = chkList.ClientID %> input:checkbox');
for (var i = 0; i < items.length; i++) {
//alert(i);
//if (items[i].value == targetValue) {
items[i].checked = true;
// break;
//}
}
$('#<%= chkList.ClientID%>input:checkbox').removeAttr('disabled'); return false;
})
});
</script>
Note: it works in Chrome, FF not in IE
Its not wroking in IE8, here is the below code. Its checking all checkboxes, but keeps them Disabled, any solution please?
