"on change"?

Posted on 2002-06-19
Last Modified: 2010-04-09
Anyone know of a way or a script that will allow a dropdown menu to open a link without having to hit a submit button? like an onchange command or something?
Question by:Reighn21
LVL 12

Expert Comment

ID: 7093203
these both events will help you.

<select onchange="javascriptfunction()">

<select onblur="javascriptfunction()">
LVL 17

Expert Comment

ID: 7093624
Be VERY careful, some people use the keyboard for navigation, this could trigger the change everytime they try to LOOK at another option.

If you are going to use a <select> as a navigation tool then this is _essential_ reading:
LVL 53

Expert Comment

ID: 7093915
<select onChange="this.form.submit()">

Not recommended because the other form fields cold be empty.

If you use it, it is s agood idea to have a default pre-selected option.

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

LVL 30

Expert Comment

ID: 7094746

<select onchange="[this.selectedIndex].value);">
 <option value="">yahoo</option>
 <option value="">google</option>

but be warned of what dorward has emphasized on his comment.
LVL 30

Accepted Solution

third earned 50 total points
ID: 7094749

please maintain your open questions and review the guidelines on grading,

Questions Asked 9
Last 10 Grades Given B B C B  
Question Grading Record 4 Answers Graded / 4 Answers Received

Expert Comment

ID: 7097258
Another similar method to the ones posted:

<FORM NAME="GoList">
<SELECT NAME="list" onChange="window.location=this.options[this.selectedIndex].value">
<option>Make a selection</option>
<option value="default.htm">Back to Home Page</option>
<option value="resume.htm">View my Resume</option>
LVL 53

Expert Comment

ID: 7100733
To any user who picks this PAQ up off of a search: the accepted answer may not be very useful. The comment that address the problem is the comment from third at 06/19/2002 09:36PM PST


Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

747 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

13 Experts available now in Live!

Get 1:1 Help Now