title: Why doesn't my form post when I disable the submit button to prevent double clicking?
body: <p>Like every other web developer on the planet, I have an issue with users double clicking the submit button on my forms.  My understanding is that the conventional way to handle this issue, is to disable the button immediately after the first click, however when I do this, <strong>it doesn't post</strong>.</p>
  
  <p>I did do some research on this, god knows there's enough information, but other questions like <a href="https://stackoverflow.com/questions/106509/disable-button-on-form-submission">Disable button on form submission</a>, disabling the button appears to work.  The original poster of <a href="https://stackoverflow.com/questions/286149/disable-button-after-submit">Disable button after submit</a> appears to have had the same problem as me, but there is no mention on how/if he resolved it.</p>
  
  <p>Here's some code on how to repeat it (tested in IE8 Beta2, but had same problem in IE7)</p>
  
  <p>My aspx code</p>
  
  <pre><code>&lt;%@ Page Language="C#" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
      function btn_onClick()
      {
          var chk = document.getElementById("chk");
          if(chk.checked)
          {
              var btn = document.getElementById("btn");
              btn.disabled = true;
          }
      }
  &lt;/script&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
          &lt;asp:Literal ID="lit" Text="--:--:--" runat="server" /&gt;
          &lt;br /&gt;
          &lt;asp:Button ID="btn" Text="Submit" runat="server" /&gt;
          &lt;br /&gt;
          &lt;input type="checkbox" id="chk" /&gt;Disable button on first click
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My cs code</p>
  
  <pre><code>using System;
  
  public partial class _Default : System.Web.UI.Page 
  {
      protected override void OnInit(EventArgs e)
      {
          base.OnInit(e);
          btn.Click += new EventHandler(btn_Click);
          btn.OnClientClick = "btn_onClick();";
      }
  
      void btn_Click(object sender, EventArgs e)
      {
          lit.Text = DateTime.Now.ToString("HH:mm:ss");
      }
  }
  </code></pre>
  
  <p>Notice that when you click the button, a postback occurs, and the time is updated.  But when you check the check box, the next time you click the button, the button is disabled (as expected), but never does the postback.</p>
  
  <p>WHAT THE HECK AM I MISSING HERE???</p>
  
  <p>Thanks in advance.</p>