473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Determine user Selection

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

Jul 12 '07 #1
3 1413
On Jul 12, 2:20 pm, Daniel <d_pinea...@hotmail.comwrote:
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

Jul 12 '07 #2
On Jul 12, 2:35 pm, David Mark <dmark.cins...@gmail.comwrote:
On Jul 12, 2:20 pm, Daniel <d_pinea...@hotmail.comwrote:
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
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

Jul 12 '07 #3
On Jul 12, 2:48 pm, Daniel <d_pinea...@hotmail.comwrote:
On Jul 12, 2:35 pm, David Mark <dmark.cins...@gmail.comwrote:
On Jul 12, 2:20 pm, Daniel <d_pinea...@hotmail.comwrote:
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

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

Jul 12 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Scott Holmes | last post by:
I've been trying to understand nearest(y) but I'm not getting it. I have a ScrolledListBox with a list of people's names. I also have a parallel list of the unique people numbers used in the...
19
by: Lauren Quantrell | last post by:
In Windows XP display Properties/Appearance users can chose between: Windows XP Style or Windows Classic Style. Is there a way in VBA to determine the user's selection? The reason: Toolbars...
3
by: BBFrost | last post by:
Ok, I know how to count the number of selected datagrid rows using the code below. What has me stumped is how to determine when the selected rows within a datagrid have been changed. The...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
1
by: Jeff S | last post by:
I would like to provide users with a text box in which they can enter a bunch of text (200 bytes or so). I would like to subsequently programmatically determine which text the user has selected. ...
2
by: Michael SL | last post by:
When a client requests to leave a Web Page, I want the web page to check for a certain condition. If that condition is met, I want to prompt the user to make sure they want to leave The method I...
7
by: Ian F. Hood | last post by:
Hi In typically windows environments I have used: if 'Windows' in os.environ... to prove it, but now I need to properly support different environments. To do so I must accurately determine what...
2
by: gazz | last post by:
Hi, Please could someone shed some light on this as I am really struggling to understand how to do this. Given a word entered into a window.prompt EG "forum", how do I create a script to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.