1 Hour SEO : Domain Registration Bank : Ecommerce Dictionary : GoDefy : Great Web Design Tips
JavaScript 2 : Jumbo Keyword : Marketing Tips Store : Michael Wong Blog : Mike's Marketing Tools
Search Engines 2 : SEO eBook : Text Links Ads : Text Links Guide
 
Web HTML-HTML.com
You are here: HTML > Forms > <SELECT ...>

Attribute for <SELECT ...>
onChange ="script command(s)"

Looking for information on dropdown menues? See our Dropdown Menu Tutorial.
onChange designates a JavaScript to run when the user chooses one of the options. This means that an action is initiated immediately when the user chooses an item, not when a "submit" button is pressed. A popular use for onChange is to make the <SELECT ...> list a set of hyperlinks. This allows you to display many links in a very compact space:

<FORM>
<SELECT ONCHANGE="location = this.options[this.selectedIndex].value;">
<OPTION VALUE="">Select a destination
<OPTION VALUE="http://www.mikes-marketing-tools.com">Mike's Marketing Tools
<OPTION VALUE="http://www.mikes-ecommerce-software.com">Mike's Ecommerce Software
<OPTION VALUE="http://www.textlinksads.com">Text Links Ads
</SELECT>
</FORM>

which gives us

It's usually better to use a submit button instead of onChange. The interface is cleaner if you separate the actions of selecting a destination and of saying "now go". See Drop Down Menu Tutorial for complete code and examples.

<SELECT TABINDEX="..."> >>>

          

Copyright © 2002-10 Art Dacor USA LLC. All Rights Reserved.
3727 West Magnolia Blvd #489, Burbank, CA, 91505, USA.
www.HTML-HTML.com