When user clicks BACK, force refresh and auto scroll.

B

Badass Scotsman

Hello,

I have an application which should never allow the back button to be pushed
without refreshing the previous page. For example:

Step 1:
User fills in form.html and presses submit

Step 2:
User see's results.html and clicks back to amend form

Step 3:
form.html MUST REFRESH ONCE and only once, which will do a few things on my
server before reloading the page.

Step 4:
After refresh, the page should SCROLL to the top of the page automatically

Pseudo Style:

If window.history.forward(1) exists
then
refresh this page and scroll to top
else
do nothing

I wonder if the following script can be modified to achieve my goal:

<script language="JavaScript"><!--
javascript:window.history.forward(1);
//--></script>

Any help greatly appreciated.

Badass.
 
R

Randy Webb

Badass Scotsman said the following on 4/26/2006 10:37 AM:
Hello,

I have an application which should never allow the back button to be pushed
without refreshing the previous page. For example:

Then your application is broken.
Step 1:
User fills in form.html and presses submit

Step 2:
User see's results.html and clicks back to amend form

Step 3:
form.html MUST REFRESH ONCE and only once, which will do a few things on my
server before reloading the page.

Set a cookie.
Step 4:
After refresh, the page should SCROLL to the top of the page automatically

Ummm, set the hash property of the location then.
Pseudo Style:

If window.history.forward(1) exists
then
refresh this page and scroll to top
else
do nothing

First, nothing in my History trail (if anything) is relevant or accessible.

Second. If I view your form and click a Favorites and navigate away
(without submitting the form), then click the Back button, your server
is gonna be hosed.
I wonder if the following script can be modified to achieve my goal:

<script language="JavaScript"><!--
javascript:window.history.forward(1);
//--></script>

Modified or scratched and start over?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top