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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to tell if BACK button used

Status
Not open for further replies.

GaryCam

Programmer
Dec 16, 2003
69
US
I have an order form which the user submits. Then a page appears stating 'Your order has been successfully placed'. My problem is that some users feel the need to use their browser's BACK button to return to the order form and submit it a 2nd, even a 3rd time.

In other areas of the program it is possible to return to the order form by clicking on <A href=&quot;orderform.asp?foo=1&quot;></A>. In those cases the variable 'foo' is recognized by orderform.asp and a function is called which zeros out all the form's fields so there's no chance of submitting the form multiple times. But how can I accomplish the same thing if someone returns to the order form via the BACK button? Is there some way that the order form can recognize that it was the BACK button that delivered the user and call that same function?

Before you suggest that orderform.asp always zero out its fields upon loading, be aware that there are instances where I do not want it zeroed out (such as returning to edit quantities). In those instances foo=0 and the zeroing function is not called.

~ Gary
 

If the user is stupid enough to re-submit their form multiple times, charge them for each order they submit.

It's the only way they'll ever learn.

Dan
 
What I do is have the order form do a database check to see if an order was already placed and display a message if there was. Then I disable the browser's cache on that page to make sure they are seeing the latest version of the page.

Adam
while(ignorance==true){perpetuate(violence,fear,hatred);life=life-1};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top