[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Pass a reference to a dropdown menu

Posted on 2011-09-18
4
Medium Priority
?
270 Views
Last Modified: 2012-05-12
Please let me know how I can pass a reference to a dropdown menu as a parameter to a function in JavaScript.

If possible, please provide some sample code. Thanks!
0
Comment
Question by:dshrenik
[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
4 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 36557871
<select onchange="myfunction(this.value)">
0
 

Author Comment

by:dshrenik
ID: 36557876
I want to pass the whole dropdown menu as a parameter (not just its value).
0
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 1800 total points
ID: 36558146
<<I want to pass the whole dropdown menu as a parameter (not just its value).>>
<select onchange="myfunction(this)">
0
 
LVL 6

Assisted Solution

by:jjperezaguinaga
jjperezaguinaga earned 200 total points
ID: 36561003
Greetings dshrenik,

Gurvinder372 is correct; "this" is the best way to send an object to a function. If you are familiar with jQuery, you can always call the form through an ID and query its elements: http://jsfiddle.net/YXagh/1/

Best regards,
-JJ
0

Featured Post

Industry Leaders: 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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

649 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