Solved

Check if an item in a dropdown is selected using javascript

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at 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…

762 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

16 Experts available now in Live!

Get 1:1 Help Now