title: JQuery .validate triggered first on the second submit
body: <p>I am trying to validate a form. The form is dynamically generated and added to div on the page. When submitting the form I want the validation to be performed at once. What happens now is that the first time I submit the form is posted without being validated. The second time I hit submit it's validate. </p>
  
  <p>Here is my script: </p>
  
  <pre><code>$("#registerform").live("submit", function(e){
                          //Prevent the form from submitting normally
                          e.preventDefault();
                         $("#registerform").validate({ 
                              rules: { 
                                firstname: "required",// simple rule, converted to {required:true} 
                                surname: "required",
                                //phonenumber: "required",
                                address: "required",
                               // address2: "required",
                                zipcode: "required",
                                username_ID: "required",
                                city: "required",
                                companyname: "required",
                                email: {// compound rule 
                                required: true, 
                                email: true 
                              }              
                              }, 
                              messages: { 
                                firstname: "Förnamn saknas" ,
                                surname: "Efternamn saknas",
                                address: "Adress saknas",
                               // address2: "required",
                                zipcode: "Postkod saknas",
                                username_ID: "Användarnamn saknas",
                                city: "Ort saknas",
                                companyname: "Företagsnamn saknas",
                                email: "Korrekt emailadress saknas"                             
                              } 
                            }); 
                          //alert("e");
                      $.post("registeraccount.php",$(this).serialize(),function(msg){
                      //alert the response from the server
                      //alert(msg);
              });
      });
  </code></pre>
  
  <p>My form: </p>
  
  <pre><code>&lt;form id='registerform' action='registeraccount.php' method='post'&gt; 
              Ägare av konto&lt;/br&gt;
              * Förnamn: &lt;input type='text' name='firstname' /&gt; &lt;br/&gt;
              * Efternamn: &lt;input type='text' name='surname' /&gt; &lt;br/&gt;
              * Email: &lt;input type='text' name='email' /&gt; &lt;br/&gt;
              * Telefon: &lt;input type='text' name='phonenumber' /&gt; &lt;br/&gt;
              Företagsinformation: &lt;/br&gt;
              * Adress: &lt;input type='text' name='address' /&gt; &lt;br/&gt;
              Adress: &lt;input type='text' name='address2' /&gt; &lt;br/&gt;
              * Postnummer: &lt;input type='text' name='zipcode' /&gt; &lt;br/&gt;
              * Ort: &lt;input type='text' name='city' /&gt; &lt;br/&gt;
  
              &lt;br/&gt;
              Kontoinformation&lt;/br&gt; 
              &lt;div id='username_message'&gt;&lt;/div&gt;
              * Användarnamn: &lt;input id='username_ID' type='text' name='username' /&gt;
  
              &lt;br/&gt;
              Företagsinformation&lt;br/&gt;
              * Företagsnamn (som kunden kommer se det): &lt;input type='text' name='companyname' /&gt; &lt;br/&gt;
              Organisationsnummer: &lt;input type='text' name='organisationnumber' /&gt;&lt;br/&gt;
              &lt;input id='submitaccountregistration' type='submit' value='Submit Comment' /&gt; 
          &lt;/form&gt;
  </code></pre>
  
  <p>How come it's not triggered on the first submit and how can I get the validation to be performed the first time I hit submit? </p>