[Javascript] How can I make document.FormName.level.selectedIndex work in IE?

Dong, Roland Roland_Dong at parade.com
Mon Apr 17 17:35:48 CDT 2006


Hello,
I have a selection box like this:

	code: 

	    
	<select name="level" id="level" size="1">
	<option value="">Select</option>
	<option value="1">Level 1</option>
	<option value="2">Level 2</option>
	<option value="3">Level 3</option>
	<option value="4">Level 4</option>
	</select>
	 
	



I want to retrieve the level value based on an event

This works on Firefox:
level=document.FormName.level.selectedIndex
alert(level);

or even

level=document.getElementById("level").value;
alert(level);

None of them work in IE. How can I make it work in IE?

Thanks million. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060417/c3de1a82/attachment.htm>


More information about the Javascript mailing list