Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> JavaScript >> Snippet

Menu - dropdown select


< html >
< head >
< script >
function formHandler(form) {
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
</ SCRIPT >
</ head >
< body >
< form name = "form" >
< select name = "site" size = 1 onChange = "javascript:formHandler()" >
< option value = "" > Go to....
< option value = " http://www.yahoo.com " > Yahoo
< option value = " http://www.metacrawler.com " > Metacrawler
< option value = " http://www.altavista.digital.com " > Altavista
< option value = " http://www.webcrawler.com " > Webcrawler
< option value = " http://www.lycos.com " > Lycos
</ select >
</ form >
</ center >
</ BODY >
</ html >