Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Disable the web browser Back button


Message #1 by inge.larsson@c... on Tue, 28 Jan 2003 15:32:06
An in-between page with an empty form that submits onLoad to the desired 
destination page will work. The user will go from (e.g.) StartPage.html to 
BetweenPage.html to DestinationPage.html and not ever see 
BetweenPage.html. If he/she clicks the Back button while in 
DestinationPage.html, the appearance will be of not being able to go back. 
In reality, he/she went to BetweenPage.html which ran the Javascript 
function to submit the form which has DestinationPage.html as the Action. 
BetweenPage.html has minimal code, something like this:

<html>
<head>
<script language=Javascript>
function NilBack() {
document.form1.submit();
}
</script>
</head>
<body onLoad="NilBack();">
<form name="form1" method="Post" action="DestinationPage.html">
<input type="Hidden" name="Nada" value="Hello">
</form>
</body>
</html>

I tested this, it should work for you.

  Return to Index