473,402 Members | 2,046 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,402 software developers and data experts.

DropDownList SelectedItem Javascript

Hi;
I can read the selectedvalue of dropdownlist by javascript using
this.value...
How can i get the selectedItem.text by javascript?
Mar 6 '06 #1
3 11926
Alper,

this.options[this.selectedIndex].value

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Alper ÖZGÜR" <al******@gmail.com> wrote in message
news:uy**************@TK2MSFTNGP15.phx.gbl...
Hi;
I can read the selectedvalue of dropdownlist by javascript using
this.value...
How can i get the selectedItem.text by javascript?

Mar 6 '06 #2
It returns the SelectedValue... Not SelectedText.....

"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com>, haber
iletisinde şunları yazdı:uQ**************@TK2MSFTNGP11.phx.gbl...
Alper,

this.options[this.selectedIndex].value

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Alper ÖZGÜR" <al******@gmail.com> wrote in message
news:uy**************@TK2MSFTNGP15.phx.gbl...
Hi;
I can read the selectedvalue of dropdownlist by javascript using
this.value...
How can i get the selectedItem.text by javascript?


Mar 6 '06 #3
Alper,

Sorry about that. I forgot to switch it from some of my code I copy and
pasted. It's pretty simple really. Just switch value to text.

this.options[this.selectedIndex].text

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Alper ÖZGÜR" <al******@gmail.com> wrote in message
news:ul**************@TK2MSFTNGP10.phx.gbl...
It returns the SelectedValue... Not SelectedText.....

"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com>, haber
iletisinde şunları yazdı:uQ**************@TK2MSFTNGP11.phx.gbl...
Alper,

this.options[this.selectedIndex].value

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Alper ÖZGÜR" <al******@gmail.com> wrote in message
news:uy**************@TK2MSFTNGP15.phx.gbl...
Hi;
I can read the selectedvalue of dropdownlist by javascript using
this.value...
How can i get the selectedItem.text by javascript?



Mar 6 '06 #4

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

Similar topics

1
by: Steve | last post by:
I'm loading a dropdownlist control from values in a database.... after I load the drop down, I need to set the selecteditem to another database value... when I do this the drop down has an...
4
by: Ivan | last post by:
Hi, I have a problem with a page which has about 50 web controls , 12 of the are DropDownList. Also, I have a "Continue" button, and on the server code an event sub btnContinue_Click, where I...
1
by: Thierry | last post by:
Hi, Is it possible to get the value of an asp:dropdownlist in javascript. I need to get that value to assign it to a hyperlink. This does not work:...
6
by: Julius Fenata | last post by:
Dear all, I have created client-side scripting to trigger event onChange from code-behind, like this: DropDownList1.Attributes = "GenerateArticleID()"; At the script on Windows Form, I...
3
by: sling blade | last post by:
Hi, I have a dropdownlist in my DataList control and I am trying to set the SelectedItem property of the dropdownlist so when the datalist displays the user will see the text in the dropdownlist...
3
by: Sam C | last post by:
Hi, I have an ASP.Net page which has a DropDownList on it. The DDL is populated via a method which is called from the Page_Load if IsPostBack = False. When the form is submitted the...
2
by: HH | last post by:
Hi, I have a dropdown list that is datafilled via a SQL table. The text part is always unique. (A list of countries) Each country is assigned one of three numbers. (This being the 'value' of...
2
by: jeffmagill | last post by:
Ive stumbled into one of those infamous problems where something stopped working for apparently no reason - in this case MyDropDownList.SelectedItem.Value. Im not sure exactly which group this...
2
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, can someone please show me how to load a dropdownlist thru javascript? thanks, rodchar
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.