Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Disabling BACK button in IE4

Disabling BACK button in IE4

Disabling BACK button in IE4

Hello, I am trying to find or write some VBScript or Javascript that will disable the browser's BACK button when a user hits my ASP. Any help would be appreciated. Stu

RE: Disabling BACK button in IE4

The only way I can see to do this is to disable the menubar using the window object or flushing the contents of the history object. So that it is empty. But then who am I to say...

RE: Disabling BACK button in IE4

I used inverse logic. Basically I coded an event handler
in the on unload event. I also coded an onclick event.
If the user clicked on a hyperlink or button on my page
I set a variable to true. When the unload event is fired
the code examines the variable to see if the user clicked
a control on the page. If he hit the back button this variable is false and I use client side redriecttion.
top.window.location.href = "URL" to redirect the client
to any page on my site. This in effect breaks the back button. An unfortunate side effect is that it also breaks
the favorites/bookmark control also preventing the user from
leaving my site. I am still working on that one.

this is my script.

SUB Link_Onclick()
ClickedOnLInk = True
End Sub

Sub t_unload()
If ClickedONlink = False then
top.window.location.href = "myurl"

End if



On the PAGE
<body OnUnload = "t_unload()">

<a href= "URL" Onlclick = "Link_OnClick">Click Here </a>


End Sub

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close