how to prevent form resubmission when page is refreshed code example
Example: prevent form resubmission on refresh
<script>
if ( window.history.replaceState ) {
window.history.replaceState( null, null, window.location.href );
}
</script>