[thelist] Java Script

deke web at master.gen.in.us
Sat Apr 7 14:21:46 CDT 2001

On 7 Apr 2001, at 15:48, Edwin Martin posted a message which said:

> >Does anybody know how to break the back button?  I am doing credit card
> >processing and I don't want them to be able to click back after their card
> >has been charged.
> In the form-processing page you should make a redirect to an
> "thanks for you submission" page.
> This way, you can't "accidentally" resubmit the form.

Nice theory, but it doesn't work. In many browsers, you can
accidently double-click on a form and submit it twice.

If you use POST for your forms, a browser is not allowed to
cache the results page, but the message the browser sends 
to the user ("OK to re-post form data") doesn't really get across
the idea that if you re-post the form data, you're submitting a
duplicate order, and that there is another way to get back 
where you were, by using the dropdown list on the BACK key.
(If you use GET, the browser has no compunctions about
submitting the data again.)

In the end, you *must* keep track of enough information (the
card number and the amount charged, perhaps) to be able to 
put up a page that says "Hey, wait a second, we just charged
an order very much like this one. If you *really* want to place
another order, <a>click here</a>, and if you don't, <a>click
here instead</a>

And browsers really need to give users a message that says
"No, I don't want you to re-post that form data; give me a *double*
back so I get past that page."  But what browsers *should* do
and what browsers *do* do is, well, it's a bunch of *do* do.


 "The church is near but the road is icy; 
  the bar is far away but I will walk carefully." 
                            -- Russian Proverb

More information about the thelist mailing list