View Single Post
Old Oct 6th, 2004, 6:56 AM   #4
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
<html>
<head>
<html>
<head>
<link href="theme/Master.css" rel="stylesheet" type="text/css" />
<script LANGUAGE="JavaScript">
   
function changeTxt(){
	
	Item = document.test.MOO.selectedIndex;
	document.write(Item);
	if (Item == 0){
 document.getElementById("test1").innerHTML = "rar this works";
	}else{
 document.getElementById("test1").innerHTML = "nay it dont";
	}
}
</script>

</head>
<body>
<form name="test" action="" method="get">
<select name="MOO" width="5" onChange=changeTxt() >
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>

<div id="test1">this is a test</div>

</form>

thats my javascript.html exactly as it is on the tin.

the error i am getting is

Line : 15
Char: 3
Error : 'document.getElementById(...)' is null or not an object
Code: 0
URL: about:blank
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote