Forum Moderators: phranque
<html>
<body>
<html>
<head>
<script language="JavaScript"><!--
function go(what) {
for (var i=0;i<3;i++) {
if (what.page[i].checked) {
document.forms[what.page[i].value].submit();
}
}
}
//--></script>
</head>
<body>
<form action="page1.htm" target="targetframename" name="page1"><input type="hidden" value="page1"></form>
<form action="page2.htm" target="targetframename" name="page2"><input type="hidden" value="page2"></form>
<form action="page2.htm" target="targetframename" name="page3"><input type="hidden" value="page3"></form>
<form>
<input type="radio" name="page" value="page1">Ann Arbor, Michigan<br>
<input type="radio" name="page" value="page2">Dexter, Michigan<br>
<input type="radio" name="page" value="page3">Jackson, Michigan<br>
<p>
<input type="button" onClick="go(this.form)" value="GO">
</form>
</body>
</html>
<script>
function gotoit(f){
for (var i=0; i < f.d.length; i++){
if (f.d[i].checked) {
location.href = f.d[i].value;
}
}
}
</script>
<form name="gotoform">
<input type="radio" name="d" value="pageone.htm" /> page one
<input type="radio" name="d" value="pagetwo.htm" /> page two
<input type="radio" name="d" value="pagethree.htm" / > page three
<input type="button" value="GO" onClick="gotoit(this.form)">
</form>
Is there some reason why this is better than using hyperlinks?
Standard links are almost always better, and if you choose to go with the above arrangement you should at least duplicate the links with standard links elsewhere on the page.