Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updating variable with dropdown item selected

Status
Not open for further replies.

Hungoverhippie

Programmer
Feb 7, 2002
11
US
Hello, This seems so simple but I cant figure it out for the life of me, I have a dropdown option list with 1-50 in it and I would like to update a variable named zQty with which number in the dropdown was selected by the user so I can use it when I am ready.

Thanks and sorry if this is a dumb question I am newer to Jscript.

Thanks!
HOH
 
>I would like to update a variable named zQty with which number in the dropdown was selected by the user...

Maybe with some hidden requirement? otherwise, it is simply this?
[tt] sQty=document.formname.selectname.value[/tt]
Here the value attribute of each option should correlate closely with the text attribute appeared for user's consumption, even exactly the same 1,2,... etc for the quantity selected.

Synchronization is done with that line appearing in the onchange handler of the select-tag element. If initialization is also needed, it also appears in the onload event.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top