What can happen is that yours CheckBoxIDis erroneous and therefore returns the wrong element.
JavaScript, checkbox.checked = false;, , checked, . , CheckBoxID , , false; , getElementById, .
, asp.net , ,
<asp:CheckBoxField Text="Hello" DataField="foo" />
html :
<span class="aspNetDisabled">
<input id="gv_ctl00_0" type="checkbox" name="gv$ctl02$ctl00" disabled="disabled">
<label for="gv_ctl00_0">Hello</label>
</span>
:
- , , , .
, , - ok, , . , β1 - .
function UncheckedItemsCheckBox(CheckboxID) {
var checkbox = document.getElementById(CheckboxID);
alert(checkbox.checked);
checkbox.checked = false;
alert(checkbox.id + " : " + checkbox.name + " : " + checkbox.checked);
}