HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 17th, 2003, 10:39 AM
Stallion112 Stallion112 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 29 Stallion112 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Trigger the Back Button in a Browser

I do not want my users to click
the back button of a browser, so
I disabled the button using the following
code. It works great.

Code:
if (window.history.length > 0){
window.history.go(+1);
}


What I would like to know, is if there is a way
I could trigger the browser's back button click
method, so I can pop up an alert window.

ie. - User clicks the Back button, which calls
a function that has an Alert Window pop up
stating "Please use the buttons on the form."

I do not want to use onUnload because
then the function will be called at incorrect times.

Help is appreciated. Thank you.

Reply With Quote
  #2  
Old December 12th, 2003, 08:05 AM
fhunth fhunth is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 15 fhunth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re: Trigger the Back Button in a Browser

Here is there a sample

http://www.webreference.com/dhtml/diner/beforeunload/

Quote:
Originally posted by Stallion112
I do not want my users to click
the back button of a browser, so
I disabled the button using the following
code. It works great.

Code:
if (window.history.length > 0){
window.history.go(+1);
}


What I would like to know, is if there is a way
I could trigger the browser's back button click
method, so I can pop up an alert window.

ie. - User clicks the Back button, which calls
a function that has an Alert Window pop up
stating "Please use the buttons on the form."

I do not want to use onUnload because
then the function will be called at incorrect times.

Help is appreciated. Thank you.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Trigger the Back Button in a Browser


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT