Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

a4poster

macrumors newbie
Original poster
Sep 11, 2010
4
0
Hi, how do I get the value of a list when a button is clicked. I can get the index of the Array by using:

var list = document.getElementById("list").selectedIndex;

But what I want to do is get the value that is held at that index, i.e, The Persons Name that is displayed.

In a web browser I can get it working without any problems but in DashCode it throws an error.

Thanks in advance, A4

PS, Previously posted in the wrong forum - sorry.
 
This is based on memory, but I believe you just access the value property.
PHP:
var list = document.getElementById("list").value;
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.