title: Form validation onsubmit - trying to run a script upon successful validation fails in FF/IE, works in Chrome
body: <p>I have a simple validation function on my HTML form and I'm trying to run a small script upon successfully submitting the form. It works just fine in Chrome but doesn't execute the JQuery stuff before returning true either in FF or IE. Why might this be?</p>
  
  <p>Basically the JQuery replaces the &lt; div > containing the input textarea with an informative text to prevent the user submitting another form until 5 seconds have passed and then switches back.</p>
  
  <pre><code>function validate() {
  
  if (textarea.value.length &lt; 1) {
  return false;
  }
  
  $("#div_with_input_textarea").hide();
  $("#div_with_informative_text").show();
  
  setTimeout(function() {
      $("#div_with_input_textarea").show();
      $("#div_with_informative_text").hide();
      }
             , 5000);
  
  return true;
  }
  </code></pre>