Prevent form submission when updating

This is the form, followed by the confirmation page, on which you must confirm the entered data of the previous form. Now, if the user refreshes this re-copy page, the data forms the previous forms. Is there a way to prevent this in JavaScript?

I know that this is not an ideal solution, it should happen on the server side. But I have no choice in this case.

+5
source share
2 answers

You cannot prevent the user from reprogramming with javascript. This needs to be done on the server side using redirect after publishing .


UPDATE

, - javascript window.location.href.

+5

JavaScript history.replaceState(null, document.title, location.href);, . MVC ( ), URL, .

+9

All Articles