WyldGynjer
MIS
I have to be doing something very simple wrong; and I can't figure out what it is...
I have a page that has a textbox and a checkbox. If the check box is checked, i want to enable the textbox. if I uncheck the check box, then the textbox should be disabled.
my javascript code is:
I'm getting an error on the very frist line of my script -- if (document.getElementByID('chkOvrdCrdRpt').checked == true)
The error is:
Microsoft JScript runtime error: Object doesn't support this property or method
I have a page that has a textbox and a checkbox. If the check box is checked, i want to enable the textbox. if I uncheck the check box, then the textbox should be disabled.
my javascript code is:
Code:
<body>
<script lang=javascript>
function onClickEnableDisable() {
if (document.getElementByID('chkOvrdCrdRpt').checked == true) {
alert('here')
document.getElementByID('txtScore').disabled = false;
} else {
document.getElementByID('txtScore').disabled = true;
}
}
</script>
<form id="form1" runat="server">
<div>
<input id="chkOvrdCrdRpt" type="checkbox" name="chkOvrdCrdRpt" onclick="onClickEnableDisable();" /><label for="chkOvrdCrdRpt">Override <br />
<br />
</label>
<input name="txtScore" type="text" value="0" id="txtScore" disabled="disabled" tabindex="70" class="TextboxSmall" />
</div>
</form>
</body>
I'm getting an error on the very frist line of my script -- if (document.getElementByID('chkOvrdCrdRpt').checked == true)
The error is:
Microsoft JScript runtime error: Object doesn't support this property or method