How to achieve this

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
After a use enters his creditcard info and clicks to place an order, how can
I expire the page if he clicks the "Back" button?

Thanks
 
you can use all sorts of meta tags on the page but none of them are a rock
solid solution. i don't honestly think there is a reliable way to prevent
the user clicking back. although you can figure out if they are re-posting
a form.

you can put in this javascript code to make sure that an attampt to go back
is never successful, provided the user has javascript enabled.

history.forward();

if there is a forward item in the history, it will go there immediately. to
put it another way, if someone clicks back then the above code should boot
them forward. i think this should prevent re-posts of the form.

some banking web sites use form submit buttons on the entire site, no
hyperlinks anywhere, and they can then do a server-side check on every page
and if there is a re-post then it is picked up and they get automatically
logged off. this is a very harsh approach but as a user you quickly learn
to avoid using the back button. not sure if this would suit your target
users who may be one-off visitors.

hope this helps
tim
 
how should i trap report? Use Page.IsPostBack?

Tim_Mac said:
you can use all sorts of meta tags on the page but none of them are a rock
solid solution. i don't honestly think there is a reliable way to prevent
the user clicking back. although you can figure out if they are re-posting
a form.

you can put in this javascript code to make sure that an attampt to go back
is never successful, provided the user has javascript enabled.

history.forward();

if there is a forward item in the history, it will go there immediately. to
put it another way, if someone clicks back then the above code should boot
them forward. i think this should prevent re-posts of the form.

some banking web sites use form submit buttons on the entire site, no
hyperlinks anywhere, and they can then do a server-side check on every page
and if there is a re-post then it is picked up and they get automatically
logged off. this is a very harsh approach but as a user you quickly learn
to avoid using the back button. not sure if this would suit your target
users who may be one-off visitors.

hope this helps
tim
 
Back
Top