hwg-basics archives | Oct 1999 | new search | results | previous | next |
Re: Dropdown Boxby Thomas James Allen <tjallen(at)pipeline.com> |
|
At 10:57 AM 10/3/99 -0400, you wrote: >Can someone send me a sample piece of code that would allow a selection >from a drop down box then a GO button that would take you to the item you >selected. > >Darryle ------------------------------- Here it is in javascript: <html> <head> <title>Drop down and go</title> <script language="JavaScript"> <!-- hide the js function goThere(){ var n=document.fred.joe.selectedIndex; var s=document.fred.joe.options[n].value; location.replace(s + ".html"); } // stop hiding--> </script> </head> <body> <form name="fred" onSubmit="goThere();"> <select name="joe"> <option value="url-01">First Location <option value="url-02"> Second Location <option value="url-03"> Third Location </select> <input type="submit" value="go there"> </form> </body> </html> Hope this helps, jimmy --- Jimmy Allen (Thomas James Allen) Business - Get Your Website Here http://www.getyourwebsitehere.com Personal - Eclecticity http://www.getyourwebsitehere.com/personal
HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA