Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling the Back Button with VBScript or JAVAScript 2

Status
Not open for further replies.

Southall

Programmer
Jul 22, 1999
1
0
0
US
How do I disable the back button when the user hits my .ASP?
 
I would like to help you but I will need a little bit more information. Could you provide a copy of the script you are having trouble with, or maybe the URL of the page this is on?
 
Goto this page and definitely hit the back button<br>
when you get there: <br>
This tutorial teaches an effective way to keep users from inadvertently leaving your web apps., but it'll only work for IE4+ (bummer). More. . .<br>
<br>
"Don't let your users exit your Web applications inadvertently. Internet Explorer's powerful onbeforeunload event handler allows you to display a built-in dialog, with your custom message, alerting the user to reasons why they should not leave the application. We discuss the JavaScript syntax and give examples of when the handler should and should not be used."
 
even better; for the 4+ browsers; you can use the onUnload event to make it *impossible* to leave your page (heh heh heh) I.E. &lt;body onUnload="window.location.replace=URL/URL/page.html; return false"&gt;<br>
<br>
I think you can probably glean the info you're needing from that; if not, email me with a little more info (or post it here) & I'll be glad to take another stab @ it.<br>
<br>
<br>
-robherc<br>
robherc@netzero.net
 
addendum:<br>
<br>
you can also use:<br>
windows.location[-1]=URL/page.***<br>
to replace records in the user's history & destroy the easiest path to get back to the prev. page; this may be a little more useful to you than my last suggestion....should work in either browser.<br>
<br>
<br>
-robherc<br>
robherc@netzero.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top