title: Re-enabling the submit button after a timeout
body: <p>The submit_pdf button saves up the information into the database and to avoid multiple clicks, i initially had disabled the submit button after one click, however now i would like to re enable the button after a timeout of 10 seconds. The part till where the submit button gets disabled is working fine, but if i try to add a delay of 10 seconds, it doesn't seem to work.It would be really helpful if you could help me out with this.</p>
  
  <pre><code>        echo '  &lt;script language="JavaScript" type="text/javascript"&gt;
          //&lt;![CDATA[
          window.open(\'./index_pdf.php?'.$query_string.'\',\'Warehouse_ST\',\'location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no\');
          id_form.submit_pdf.disabled=true;
          window.alert("Data is stored in the database, Please do no click on Submit again without changing any information");
  
          window.addEvent(\'domready''\',function() 
          {
          var subber = $_REQUEST["submit_pdf"];
          subber.addEvent( \'click'  ,function() ' 
          {
           subber.set( \'value','Submitting...''\' ).disabled = true;
          (function() { subber.disabled = false; subber.set(\'value','submit_pdf'\'); }).delay(10000); // how much time?  10 seconds
          });
          });
  
  
          //]]&gt;
          &lt;/script&gt;';
  </code></pre>