473,466 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

When user clicks BACK, force refresh and auto scroll.

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.
Apr 26 '06 #1
1 6688
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?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bruce | last post by:
I have a number of forms that do significant work based on variables POSTed from the form. What is the common method of detecting and preventing this work from being done when the form is POSTed as...
9
by: Mark | last post by:
I have a working PHP/MySQL application used for data entry. The data entry screen includes a "Save" button. The PHP code for this button looks like this: if (isset($_POST)) { if ($_POST ==...
14
by: Simon Wigzell | last post by:
I want to display HTML text inside a div and have the page open scrolled to the bottom. (My div has overflow:auto so that it appears with scroll bars) I have found this that works on a textarea:...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
5
by: antonyliu2002 | last post by:
I have 4 forms each on a separate page respectively form1.aspx, form2.aspx, form3.aspx, form4.aspx. On top of each of the four pages there are 4 links which link to the aforementioned 4 pages...
1
by: Gary | last post by:
Is it possible to refresh a browser window when a secondary browser window has been closed? For example, I have a main web form that functions purely as a datagrid, when a user clicks on a...
4
by: morc | last post by:
hi, is there any way to refresh the page when the user clicks back button?I have a jsp page that i need to regerenate everything everytime the user visits it. its either that or i want to...
17
by: Zytan | last post by:
I can scroll a WebBrowser to the bottom like so: if (webControl.Document != null) webControl.Document.Body.ScrollTop = int.MaxValue; But, if I include a proper DOCTYPE (for XHTML 1.1 DTD) like...
1
by: Jake Barnes | last post by:
I searched comp.lang.javascript on Google Groups but I didn't find an answer when I searched for "viewport" or "viewport div" or any combination of words using "viewport" so now I think I'm...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.