For some reason, I can't extract the value out of a drop down list.
When the user clicks a text text box, I want an alert to come up with the value of the selection list.
In the following page, the alert box always comes up empty.
Code:<html> <head> <SCRIPT LANGUAGE=javascript> <!-- function foo(){ ind = document.myform1.cost.options.selectedIndex val = document.myform1.cost.options[ind].value alert(val) 'also tried alert(document.myform1.cost.value) -- doesn't work document.myform1.cost.focus() } --> </SCRIPT> </head> <form name="myform1" action="run.asp" method="POST"> <select name="cost"> <option>60</option> <option>70</option> <option>80</option> <option>90</option> <option>100</option> </select> <input type="text" name="text1" onfocus="foo();"> </form> </html>
Why doesnt this work?!!
tx
dvst8




Reply With Quote