title: jQuery hide form on submit?
body: <p>I have a form setup where a user can register, and on submittal, a PHP script runs which validates the user, and once that is done, it echoes a messagebox which jQuery quickly hides and then fades in over the course of 1 second. What I now want to do is to be able to hide that form on submittal, and I thought this might do it:</p>
  
  <pre><code>$(document).ready(function() {
      $('div.mainsuccess,div.mainerror').hide(0).fadeIn(1000);
      $('form.register').submit(function() {
          $(this).hide(1000);
      });
  });
  </code></pre>
  
  <p>Where <code>div.mainsuccess</code> is the success message, and <code>form.register</code> is the form (with a class of register). Now the first line works, which tells me the script is being called, but the form is not being hidden at all. I'm doing something stupid here, but I cannot figure out what?</p>
  
  <p>I've tried to look through the jQuery API documentation for <code>submit()</code>, but I cannot understand what is being said. Thanks. </p>