• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1481
  • Last Modified:

Check if an item in a dropdown is selected using javascript

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
amukta
Asked:
amukta
  • 2
  • 2
1 Solution
 
Shahzad Fateh AliWeb Solutions Architect & Technical Project Manager- VentureDive (Pvt) LtdCommented:
Hi,

Try this

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

Open in new window

0
 
amuktaAuthor Commented:
it is not working.
0
 
Shahzad Fateh AliWeb Solutions Architect & Technical Project Manager- VentureDive (Pvt) LtdCommented:
Can you paste your code here. I will make it work
0
 
amuktaAuthor Commented:
I made it work.
Thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now