Prevent double/triple clicking on Done button using JavaScript
<p>I want to prevent the double/triple clicking issue for my "Done" button in my application.
I have my "Done" button as below in my .jsp file:</p>

<pre><code>&lt;ip:button name="Done" 
           text="Done"
           jsEvent="onclick=\"if(submitPage() &amp;&amp; doneSubmit()) 
           { request.value = 'DONE_REQUEST'; submit(); }\"" /&gt;
</code></pre>

<p>And the submitPage() is the JavaScript method as below:</p>

<pre><code>function submitPage(){
    if (pageLoaded &amp;&amp; !hasSubmitted ){
        hasSubmitted = true;
        return true;
    }
    else{
        return ! showWaitMsg();
    }
}
</code></pre>

<p>submitPage() method is used by other buttons as well.</p>

<p>So I was thinking to using the submitPage() method to disable "Done" button (only the "Done" button) once the button is clicked and enable it once "hasSubmitted = true;".
Can anyone please advise how could I do it?</p>