[HTML] Preventing Duplicate Form Submission on F5 Refresh

Page A has a form.
You submit this page and are redirected to page B.
On page B, pressing the refresh key will trigger a dialog asking to resend the form data.

This problem can be solved from the web development perspective.
Page A submits to your server page (ASP, JSP).
The server page processes the request but does not return page B to the user directly.
Instead, it returns a simple page C, such as a redirect page.

This immediately redirects to page B – in this case, main.jsp.

If you refresh on page B, the resend dialog will not appear.
If you press “Back” on page B, you will go back to page A.
The user will not notice the intermediate page C at all.

Going further, you can design a JavaScript dialog box that, once confirmed, will not pop up again regardless of whether the user refreshes or navigates back.
redirect.jsp

Licensed under CC BY-NC-SA 4.0