title: Executing function only once
body: <p>I have a register form where visitors can sign up, and when they press the submit button the div containing the register form is being moved slightly to left so that it appears in the middle. </p>
  
  <p>The code doing that works fine, but if the visitor has wrote something wrong in the register form they need to be able to try again, but then the register form will be moved once again, if this is repeated a few times it will move out of the container totally.</p>
  
  <p>How can I trigger a function only once? Here is my current code:</p>
  
  <pre><code>...
  
  $('#form form').submit(function(){
  
  // Some code for showing "loading" image etc..
  
  });
  </code></pre>