Prevent or clear back history with form submission
<p>I have a small quiz web application to deploy.</p>

<p>Basically I have 2 pages, '1) Quiz page' and '2) Result page'. Upon submitting the Quiz form, it will generate the result on the result page for the user. However I need to prevent user from clicking on back button or keying in Backspace on the keyboard.</p>

<p>I researched the use of 'location.replace()' but have no idea how can I implement it within my form:</p>

<pre><code>&lt;form id="quiz" name="quiz" method="post" action="result.php"&gt;
...
&lt;input type="submit" name="Submit" value="Submit" /&gt;
&lt;/form&gt;
</code></pre>

<p>I would like to know if there is any way for me to use location.replace() within the form, or otherwise, any other way that I could prevent/clear user from getting back to the history page.</p>

<p>Thank you.</p>
