Javascript woes

I’m having a little javascript trouble, and was hoping someone could toss me a clue. Here’s my code:


<html><head><title>Test Page</title>		

<script>function first(){divsecond.style.visibility = 'visible';}</script>

</head>
	
<body><p>Test form...let's see if this works.</p>
		
<form name="testform" action="test.html" method="get">
<select name="first" onChange="first();">
<option></option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
<div id="divsecond" style="visibility:hidden">
<label for="divsecond">
<select name="second"></select></label></div></form>
	
</body></html>

Note that this is not how I’d normally write code; I’ve just condensed it to make it shorter.

The problem is with the onChange modifying that first select tag. It won’t let me use my own functions with it. If I were to change that to document.forms.testform.submit(), it’d work just fine. As is, it tells me that the object doesn’t support this property or method–but it does, goshdarnit!

Any light to shed on this?

Maybe it’s because the name of the select tag and the name of the function are the same? Try calling the function something else.

Huh…damned if it doesn’t work. Well, there’s one mystery cleared up. Thanks a bunch, Armilla, and welcome to the board!