Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Thursday, March 9th, 2006

Time Event
5:13p
Select Index value
I know this is simply a syntax issue but I cant seem to find the right combination and I am wasting time....

Ok I have a form that is dynamically generated with PHP. (because it can grow rows)

each "row" of the form has a pulldown on the left.

I am naming and id-ing each pulldown with a sequential name.

What I need is to get the selected index of the pulldown on change. I am sending to the function the name of the pulldown and assigning the variable "id"

Doesn't work var box = document.segments.ElementsById[id];

Doesn't work var box = document.segments.elements[id];

Doesn't work var box = document.segments.id;

I keep getting the "No properties error" box


For the index I combine it with
var Content = box.options[box.selectedIndex].value;


Any ideas?

<< Previous Day 2006/03/09
[Calendar]
Next Day >>
About LiveJournal.com
Image