Disabling submit button stops form from being submitted PHP / Javascript
<p>I think I got a classic problem but I was not able to find a working solution so far.</p>

<p>I have got a form , the user clicks "Send" and everything works fine using a PRG pattern and doing both client-side and server-side validation.</p>

<p>The problem arises when any user (let's assume he entered valid inputs) clicks more then once quickly before the server script ends its execution...</p>

<p>I do not get any duplicated entry because I took care of that but the browser does not go to my "thanks for submitting page".
Instead it re-submits the same page with the same values and what I get are the custom errors I set to warn the user he is trying to enter details already stored in the database. The details sent in the first place are all in the database but the user has no chance to know that.</p>

<p>I tried to disable the submit button on a submit event using jQuery but in that case the data are not submitted. </p>

<p>HTML</p>

<pre><code>   &lt;div id="send-button-container"&gt;
   &lt;input id="send-emails" type="submit" name="send_emails" value="Send"/&gt;
   &lt;/div&gt;
</code></pre>

<p>jQuery</p>

<pre><code>   $(document).ready(function(){

        $('#mail-form').submit(function(){
        $('#send-emails').attr('disabled','disabled');
        });
   });
</code></pre>

<p>I am wondering if I can force a submission using Javascript after disabling the button and also how to deal with UAs with Javascript disabled</p>

<p>Thanks in advance</p>
