Hi Everyone,

I'm trying to get a textbox filled with a 1 or nothing mattering on if the checkbox has been checked. Can someone tell me what I'm doing wrong here?

Thanks!
James

Code:
<html>
<head>
<script language = "JavaScript">
	function initialChkOO2()
	{
		var chkBox = document.getElementById("chk");
		var txtBox = document.getElementById("text");
		if(chkBox.Checked)
		{
			txtBox.value = "1";
		} 
		else
		{
			txtBox.value = "";
		}
	}
</script>
</head>
<body>
<form>
<input type = "checkbox" onClick ="initialChkOO2()" id = "chk" name = "chk"/>
<input type="textbox" id = "text" name = "text"/>
</form>
</body>
</html>