Forum Moderators: phranque
Here's the Javascript, placed in the head or an external file:
function gotoPage( menuform )
{
var baseurl = "http://www.example.com" ;
selecteditem = menuform.newurl.selectedIndex ;
newurl = menuform.newurl.options[ selecteditem ].value ;
if (newurl.length!= 0) {
location.href = baseurl + newurl ;
}
}
And your HTML will look something like this:
<form action="">
<p><select name="newurl" onchange="gotoPage(this.form)">
<option value="/path/to/file1.html">Link 1</option>
<option value="/path/to/file2.html">Link 2</option>
</select></p>
</form>
Just place your base path in the place of the example.com, and then in the value part of the option, place the rest of the path from the base path to the file.