Determine user Selection

D

Daniel

Hello,

I am trying to pass the slection made by a user to a javscript
function using the onchange event. The problem is I can get the index
but not the actual value. As my list is variable (dependent on a db)
I cannot hard code to a static index. I either need a way to
determine the number of items in a select control or a way to
determine the actual selection made by the user.

Can anyone enlighten me as to the code to determine what option the
user selects?

Thank you for your help.

Daniel
 
D

David Mark

Hello,

I am trying to pass the slection made by a user to a javscript
function using the onchange event. The problem is I can get the index
but not the actual value. As my list is variable (dependent on a db)
I cannot hard code to a static index. I either need a way to
determine the number of items in a select control or a way to
determine the actual selection made by the user.

Can anyone enlighten me as to the code to determine what option the
user selects?

this.options[this.selectedIndex].value
 
D

Daniel

I am trying to pass the slection made by a user to a javscript
function using the onchange event. The problem is I can get the index
but not the actual value. As my list is variable (dependent on a db)
I cannot hard code to a static index. I either need a way to
determine the number of items in a select control or a way to
determine the actual selection made by the user.
Can anyone enlighten me as to the code to determine what option the
user selects?

this.options[this.selectedIndex].value

I cannot thank you enough. I knew it would be simple, but I've been
looking for this answer for hours and couldn't find it! I was
starting to pull my hair out. Thank you!!!!

One last little question, could you refer me to a few good online
recources for javascript w/ forms or webpages

Thank you,

Daniel
 
D

David Mark

this.options[this.selectedIndex].value

I cannot thank you enough. I knew it would be simple, but I've been
looking for this answer for hours and couldn't find it! I was
starting to pull my hair out. Thank you!!!!

One last little question, could you refer me to a few good online
recources for javascript w/ forms or webpages

Thank you,

Daniel

jibbering.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top