How to control the browser buttons using java script?
<p>I need to disable the browser back button while cliking the submit button in html page to secure the process has not terminated.</p>

<p>Here is the code to disable the back button in browser, but it's working in onload event only. when i am trying to use this in onclick event it wont work.</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head runat="server"&gt;
&lt;title&gt;New event&lt;/title&gt;
&lt;/head&gt;
&lt;SCRIPT type="text/javascript"&gt;
window.history.forward();
function noBack() { window.history.forward(); }
&lt;/SCRIPT&gt;
&lt;/HEAD&gt;
&lt;BODY onload="noBack();"
onpageshow="if (event.persisted) noBack();" onunload=""&gt;
&lt;a href='page2.html' &gt;Page 2&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Can anyone know how to disable the browser back button while i am clicking submit button in html page </p>
