Re: Dropdown Box (CORRECTION!!!)

by Thomas James Allen <tjallen(at)pipeline.com>

 Date:  Tue, 05 Oct 1999 07:06:17 -0400
 To:  "Darryle Toney" <Darkrose(at)darkrose-bds.com>
 Cc:  hwg-basics(at)hwg.org
  todo: View Thread, Original
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
---------------------

OOOPS!
My previously posted message contains errors!   :(

Here is the corrected javascript for a drop down and go:

<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">
<select NAME="joe">
<option value="url-01">First Location
<option value="url-02"> Second Location
<option value="url-03"> Third Location
</select>
<input type="button" value="Go" onclick="goThere();">
</form>


</body>
</html>

Instructions: replace the url-01, etc above with your urls, 
but without the ".html"  The javascript adds the ".html"

Sorry, wishing I could take that last message back!
Embarrassed!!
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