Code: Select all
<form name="cc">
<p><select name="selector" size="1" onchange="go()">
<option value="http://<MY_SERVER>/path1/">f1</option>
<option value="http://<MY_SERVER>/path2/somefile">f2</option>
<option value="http://<MY_SERVER/">HOME</option>
</select>
<input name="test" value="AAAAAAAA" onclick="go()" type="button">
</p>
<script type="text/javascript">
function go() {
alert('Foo!');
window.location.href=document.cc.selector.options[document.cc.selector.selectedIndex].value
}
</script>
</form>
This is not intuitive - given the presence of that button, I would expect to need to click it for the navigation to occur. However, with script disabled clicking it does nothing.
What's so special about the name "go", and why the button isn't the JS link that's fixed in this case?