Javascript code:
// Get the checkboxlist object.
var objCtrl = document.getElementById('<%=chkNeighborhoodFeatures.ClientID %>'); // Does the checkboxlist not exist?
if(objCtrl == null)
{ return;
}
var i = 0;
var chkNeighborhoodFeaturesArray = objCtrl.getElementsByTagName('input');
// iterate through listitems that need to be enabled or disabled
for(i = 0; i
{
objItem = document.getElementById('<%=chkNeighborhoodFeatures.ClientID %>' + '_' + i);
if(objItem == null)
{
continue;
}
// Disable/Enable the checkbox.
objItem.disabled = true;
// Should the checkbox be disabled?
objItem.checked = false;
}
1 comment:
Part of you for loop was truncated:
for(i = 0; i
Should be:
for(i = 0; i<chkneighborhoodfeaturesarray.length; i++)
I got the missing part by doing a view source.
Your code works but is there a way to also dim the text? It's hard to tell that the checkboxes are disabled.
Post a Comment