Is there a way to keep a user from re-posting form data if they hit the back button or refresh? What is the best way to deal with this besides disabling the back button? Can I use javascript to clear out all form data from previous pages? Thanks.
So they're filling in a form, pressing submit, getting a results page, pressing [Back] and submitting the form again?
I can't think of an easy way of stopping that, you could probably do something with cookies but it would be quite fiddly. You'd also have to deal with the possibility that people might need to come back one day and fill your form in again (or possibly another person using the same PC as the first).
But are you sure that's what people are doing? It seems a bit unlikely to me. If you're getting the same data submitted multiple times it's more likely to be because they're clicking the submit button more than once. You can stop that with javascript using a script like
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.