CodeAve.com CodeAve.com - JavaScript - Forms
ASP
JavaScript
·Document Info
·Forms
·Images
·Miscellaneous
·Navigation
·Script Writers
·Contents
·What's New?
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Dropdown Menu
Dropdown menus are great for directed input into your applications, but can also be used for navigation purposes. If you have a list of links and not much space on your page a dropdown menu will enable long lists to take up as much or as little space as you’d like. The following example lists some of the top internet sites. When one is selected and the Go button is clicked the browser will be directed to that site.
View the Output
Text View
Print View
Mail this Link
Download the Code

<html>
<title>CodeAve.com(JavaScript:Dropdown Menu)</title>
<body bgcolor="#FFFFFF">

<script language="JavaScript">
function pulldown_menu()
{
// Create a variable url to contain the value of the 
// selected option from the the form named pulldown and variable selectname
var url = document.pulldown.selectname.options[document.pulldown.selectname.selectedIndex].value

// Re-direct the browser to the url value
window.location.href = url 
}
</script>


<center>

<form name="pulldown">
<select name="selectname" SIZE="1">
<option value="">Select A Site</option>
<option value="http://www.yahoo.com">Yahoo.com</option> 
<option value="http://www.goto.com">Goto.com</option> 
<option value="http://www.altavista.com">AltaVista</option> 
<option value="http://www.go.com">Go.com</option> 
<option value="http://www.msn.com">MSN.com</option> 
</select>
<input type="button" value="Go" onClick="JavaScript:pulldown_menu()">
</form>

</center>
</body>
</html>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
Links | Search Engine db |  Privacy Statement |  Advertising Rates |  Email

CodeAve.com is hosted by MyHosting.com
Donate Food Online with a Mouse Click at TheHungerSite.com
Donate Land Online with a Mouse Click at TheRainForestSite.com
© 1999 - 2010 CodeAve.com
All Rights Reserved