Website Designers R Us - Home
How to create active drop down lists without using CGI

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', '' );"
 

 

Return to Listing

Website Designer R Us is the right company to get your job done professionally and cost effectively. We've seen the good, the bad, and the ugly, and we are here to help you by recommending the services that match your needs based on our knowledge of other website designers and web design companies whom can perform the type work you are needing.
 Home          ::             About Us          ::             Support            ::             Services            ::             Link Partners          ::             Contact

Copyright © 2006-2007 Website Designers R Us, a DOT Specialist Company. All rights reserved.