Solved

Check if an item in a dropdown is selected using javascript

Posted on 2008-10-21
4
1,461 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery detect if it is a mobile device 3 107
CSS Position not returning 2 48
jquery to restrict certain words from input in form 11 19
Objects on Same Line 2 18
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

864 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now