Page 1 of 1

hitting f5 after hitting the submit button

Posted: Wed Oct 17, 2012 10:19 pm
by cali_dotcom
i have a php application where users can apply for a bonus. but there is a confirmation page before the bonus redemption code runs. the issue is that in IE, if you hit f5 right after you click the continue button, the confirmation page refreshes while the bonus redemption code had already been triggered by the continue button and actually goes through. but because the user still sees the confirmation page, they would hit the continue button again and now they get an error cause they are already registered.

is there a way i can disable the f5 button using javascript? is this the best way to go about this? i have tried many scripts i found online to do this, but none of them achieves it. is there a better way i can go about this? perhaps from the application side?

any input will be appreciated.

Re: hitting f5 after hitting the submit button

Posted: Tue Oct 23, 2012 5:38 pm
by social_experiment
http://www.daniweb.com/web-development/ ... in-mozilla
^ Could be useful.

That said, remember that javascripts' state (on or off) isn't determined by you but by the browser of the user so even with this code stooping f5 use it might not stop the issue. An server side alternative might be the way to go.

Re: hitting f5 after hitting the submit button

Posted: Tue Oct 23, 2012 9:54 pm
by Christopher
Usually the solution to refresh resubmit problems is to redirect to a different URL after submit. Then refresh does not resubmit.