Form fields are resetting if I click the browser's back button

I just noticed that my registration page is resetting ALL fields if the user encounters an error and needs to click the back button. This is a recent change, because my website didn’t used to do that.

Does anyone know what would cause this?


I believe it is safe not to allow them to have any data entry when they hit the back button on a browser. Why? Because let’s say for example, this was an online quiz. When the user goes to submit the data and they find out their results. They can potentially use the back button as a safe guard and re-submit their data. Making their score go from 20% to 100%. Now is that what you want?

I typically like my users to start with a fresh data entry if they want to abuse the back button on browsers. However since this isn’t my topic, I’d say store everything on a temporary session. Basically, if the user gets to an error, it’ll redirect them back to your desired page along with the information they have entered. Now, here’s the tough part. When I say “temporary”, I mean on the page of the submit form, I’d unset the session at the way bottom of the page because typically, when the user re-visits your page, you don’t want to show them their last data entry, this could be a bad thing. So I’d say unset their data entry. When they get redirected though, set the proper sessions so that the data are entered in the fields. When they get redirected, the sessions won’t be deleted because they are redirected, not refreshed. When they re-visit the page, the data is deleted if there are any sessions relating to those fields.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.