On clicking the browser's back button load the page in GET form and not POST

I am on a form-submitted (POSTed) thank you page, say page A.
I click a link on A which goes to page B.
I click on the browser’s back button on B to go back to page A.

Issue is, A is form-submitted and hence I get “Confirm Form Resubmission”

A will reload well if not POSTed because I show content when A is loaded in the URL as GET. (I cached the POSTed page)

So how do I control the back button to load page A as a regular URL and not as a form submitted (which is trying to re-submit) one ?

You need to implement PRG. Post, Redirect, Get.

1 Like

Why isn’t this so popular ?

    if (window.history.replaceState)
    {
        window.history.replaceState( null, null, window.location.href );
    }