title: disable button with timeout
body: <p>I have this form with conditions that alert validation errors before posting data. the problem is if someone double clicks (by mistake perhaps), the form is submitted, then the form is cleared on the first click then the second click will alert 'form empty', which could be confusing as it all happens in a split second. so what I want is to temporarily disable the button when clicked for 3 seconds. but what I have now just times out the whole function for 3 seconds not just disabling the button. how should I be doing this? here is a simplified version of the form. Thanks</p>
  
  <pre><code>$('#send').click(function(){
  
     var self = $('#send');
         setTimeout(function() {
         self.disabled = false;
     if(!$('#text').val()){
        alert('field empty');
    }else{
          $('#message').html('done');
          $('#text').val('');
      }
    }, 3000);
  });  
  </code></pre>