hi.. i seems to have problem implementing a javascript function to select/deselect all checkboxes in the list.. when the All checkbox is being checked, nothing seems to be happening.
Javascript Code
function toggle(source) {
checkboxes = document.getElementsByName('chbBUList');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].checked = source.checked;
}
}
Tags use in my page:
<script src="script/script.js" type="text/javascript"></script>
...
<asp:CheckBox ID="chbAllBU" runat="server" onClientClick="toggle(this);" Text="All" />
<asp:CheckBoxList ID="chbBUList" runat="server" RepeatLayout="Table" RepeatColumns="4"></asp:CheckBoxList>
if i change onClientClick="toggle(this); in to this onClick="toggle(this);
an runtime error stating function toggle(this) is undefined..