Forum Moderators: open
ie how do I get the following to link to the page when selected?
<select name="Menu">
<option value="page1.htm">page 1</option>
<option value="page2.htm">page 2</option>
<option value="page3.htm">page 3</option>
</select>
Would it use some kind of onChange like this:
onChange="javascript:window.location.href='...'
<script type="text/javascript">
function go(where){
window.location.href=where;
}
</script>
<select name="Menu" onchange="go(this)">
<option value="page1.htm">page 1</option>
<option value="page2.htm">page 2</option>
<option value="page3.htm">page 3</option>
</select>
I'm not very good at javascript!
ok, it tried it, I just get an error message in the browser.
Somtimes it says '...undefined'
other times it says 'mysite\[object]'
I put this in the body:
<select name="Menu" onchange="go(this)">
<option value="index.html">Home</option>
<option value="page2.htm">Page 1</option>
<option value="page3.htm">Page 2</option>
</select>
I put this in the head:
<script type="text/javascript">
function go(where){
window.location.href=where;
}
</script>
<SELECT onChange="self.location.href=options[selectedIndex].value;">
...
</SELECT>