accessing selectedIndex

wxdqz

New Member
It seems this should be simple, but ...
I have a select list containing a list of products. The select is the first element in the only form in the document. I want the selected product name to appear a couple of places in some boiler plate text at the bottom of the form. I tried creating a little function that I placed in the <head> </head> that would document.write the product name when called from the appropriate place(s) in the boiler plate. Problem is, the function is able to see and write out document.forms[0].elements[0].options.length ok. It is able to see and write out document.forms[0].elements[0].options[number].value ok if I supply an actual numeral. However, the function cannot see document.forms[0].elements[0].options.selectedIndex although it seems like it should be able to. No matter what option is selected from the list, the selectedIndex is always given as "0". Is this a scope issue? This seems like a trivial thing that folks would want to do all the time, so the answer, I assume, should be simple. Any hints??
 
Top