Click to See Complete Forum and Search --> : Just a little problem.


gokou
08-03-2003, 01:08 AM
I'm trying to make a back, forward and a go button that will go back and forward through pages or you can type in a text box and click on the go button to go somewhere. I can't get the go_to(); function to work. Heres the code.

<script>
function go_back() {
navbar.url.value="";
history.back();
setTimeout("document.navbar.url.value=location.href;",1000);
}

function go_forward() {
navbar.url.value="";
history.forward();
setTimeout("document.navbar.url.value=location.href;",1000);
}
function go_to() {
location=document.navbar.url.value;
}
</script>
<form name="navbar" onsubmit="go_to(); return false;">
<input type="button" value="back" onClick="go_back();">
<input type="button" value="forward" onClick="go_forward();">
Url:
<input type="text" size="50" name="url">
<input type="button" value="go" onClick="go_to();">
</form>

jdavia
08-03-2003, 01:45 AM
Seems to me that you need to insert the URL here in each instance.
navbar.url.value="ThePage.html";

It may not work if you don't first display the page to go back.