Solved

Check if an item in a dropdown is selected using javascript

Posted on 2008-10-21
4
1,465 Views
Last Modified: 2012-05-05
Hi!

I have a dropdown list in a column of a datagrid.
How do I check , which item is selected from the dropdownlist or if at all anything is selected, using javascript.
It's EXTREMELY URGENT.
iF i CAN GET THE CODE/LOGIC , THAT'LL BE GRREAT.

THANKS IN ADVANCE.
0
Comment
Question by:amukta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Shahzad Fateh Ali earned 500 total points
ID: 22773729
Hi,

Try this

function findSelection(){
	var list = document.getElementById('mySelect');
	var val = list.options[list.selectedIndex].value;
        alert(val);
}

Open in new window

0
 

Author Comment

by:amukta
ID: 22797902
it is not working.
0
 
LVL 9

Expert Comment

by:Shahzad Fateh Ali
ID: 22798589
Can you paste your code here. I will make it work
0
 

Author Comment

by:amukta
ID: 22800143
I made it work.
Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question