title: Generic selection using jquery validate
body: <p>As a relative jquery novice please bear with me if there is a simple solution to my problem. Using jquery validate works beautifully when selecting by <code>unique ID</code> eg.</p>
  
  <pre><code>$("#myForm").validate({
      debug: false,
      rules:
      {
           field1: "Required"
      },
      messages:
      {
           field1: "Required"
      },
      submitHandler: function(form) {
           $.post('formAction.php', $("#myForm").serialize(), function(data) {
              $('#results').html(data);
           });
      }
  });
  </code></pre>
  
  <p>I need to extend this to work generically with a number of automatically generated forms <code>myForm1, myForm2</code> etc.</p>
  
  <p>Can I validate via a common class selector <code>$("myForm")</code> and then apply the <code>submitHander</code> to the specific form (<code>myForm1</code>, <code>myForm2</code>, etc.) eg:</p>
  
  <pre><code>$(".myForm").validate({
      debug: false,
      rules:
      {
           field1: "Required"
      },
      messages:
      {
           field2: "Required"
      },
      submitHandler: function(form) {
           $.post('formAction.php', $(this).serialize(), function(data) {
              $('#results').html(data);
           });
      }
  });
  </code></pre>
  
  <p>Many Thanks</p>