Would you like to have a space saving drop down list on your page containing a list of your favorite pages that you can visit with a simple button click as in the example below?
Don't worry if you don't have CGI access; the above drop down list was implemeted using JavaScript. Let's look at the source code (simply paste the following code block and customize it to add a drop-down list to your page):
<form name="form1" method="POST">
Select a page to visit:
<select name="dd1" size=1>
<option value="http://www.websitedesignersrus.com/tips/delphi/">
Delphi Tips
</option>
<option value="http://www.websitedesignersrus.com/tips/internet/">
Internet Tips
</option>
<option value="http://www.websitedesignersrus.com/tips/windows/">
Windows Tips
</option>
</select>
<input type="button"
onClick=
"location =
document.form1.dd1.options
[document.form1.dd1.selectedIndex].value;"
value="GO">
</form>
The onClick code is the magic code that instruct JavaScript enabled browsers to redirect to a different location depending on the selected drop-down list item.
location =
document.form1.dd1.options
[document.form1.dd1.selectedIndex].value;
To have the selected page open in a window other than inside the current document, if you're using frames for example, use the following onClick code instead (assuming "win_name" is the name of the new window or target):
onClick=
"window.open(
document.form1.dd1.options
[document.form1.dd1.selectedIndex].value,
'win_name', '' );"