Ken1 a écrit :
Hello, lets say i have a select like this:
<select name="numbers" id="numbers">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
Lets say a user selects "Two" from the drop down menu... now I want to
get that "Two" into a variable... but not "2" because i can get 2 by
using numbers.value..... but how could i get the "Two" into a variable?
var o = document.forms['myForm'].elements['numbers'].options
myVariable = o[o.selectedIndex].text;
o = document.myForm.numbers.options;
o = document.forms[0].numbers.options;
<select name="numbers" id="numbers"
onchange="var k = this.selectedIndex;
myVariable = this.options[k].text;
">
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date