...

View Full Version : Selectbox script error



CreativeGPX
05-08-2004, 09:16 PM
I keep getting errors with this script.

Note: The name of the form is form, so that's right too. :thumbsup:
Here is the code for the select box:
<select name="simselect" size="1">
<option value="0001">0001</option>
<option value="0002">0002</option>
</select>

Here is the script: (I narrowed it down to this spot)
{
if(document.form.simselect.options[document.form.simselect.selectedindex].value == "0001") {
//I took this section out and still got the error
}

nolachrymose
05-08-2004, 09:30 PM
if(document.form.simselect.options[document.form.simselect.selectedIndex].value == "0001") {

The property is selectedIndex, not selectedindex.

Hope that helps!

Happy coding! :)

CreativeGPX
05-08-2004, 09:46 PM
Thanks a lot! :) :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum