For some reason, the code below is giving me an error:
Error: 'document.Update[...].checked' is null or not an object[\i]
Error: 'document.Update[...].checked' is null or not an object[\i]
Code:
<html>
<head>
<title>Enable / Disable</title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function fncEnable(chkname)
{
if(document.Update["chk_"+chkname].checked == true)
{
document.Update[chkname].className = 'enabledclass';
document.Update[chkname].disabled = false;
}
else
{
document.Update[chkname].className = 'disabledclass';
document.Update[chkname].disabled = true;
}
}
//-->
</SCRIPT>
<style>
.enabledclass{background:ffffff}
.disabledclass{background:efefef}
</style>
</head>
<body>
<form name="Update" method="post" action="">
<input type="checkbox" name="chk_name" value="1" OnClick="fncEnable(name)">
<input type="text" name="name" value="" DISABLED CLASS="disabledclass">
</form>
</body>
</html>
[\code]