?
Solved

Check if an item in a dropdown is selected using javascript

Posted on 2008-10-21
4
Medium Priority
?
1,467 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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
Suggested Courses

801 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