title: jquery validate on elements not yet created
body: <p>I'm wondering if it's possible to have the jQuery Validator plugin validate elements that don't yet exist in the dom when the rules are initially setup.</p>
  
  <p>Calling the .Rules("add", therules) method only attaches the rules to elements that currently exist in the dom. If I were to create some. The validation doesn't fire. Any thoughts?</p>
  
  <p>Homepage of the validator I am using: <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" rel="nofollow noreferrer">http://bassistance.de/jquery-plugins/jquery-plugin-validation/</a></p>
  
  <p>New elements are being created via <a href="http://ejohn.org/blog/javascript-micro-templating/" rel="nofollow noreferrer">http://ejohn.org/blog/javascript-micro-templating/</a></p>
  
  <p>Basically there's an ajax call and the server returns a bunch of json (ajaj?), this json is fed through with the resig's templating engine. An example template looks like so:</p>
  
  <pre><code>&lt;script type="text/html" id="ProductsTemplateEdit"&gt;
      &lt;td&gt;
          &lt;input type="hidden" value="&lt;#= item.ID #&gt;" id="Edit.ID" name="Edit.ID" /&gt;
          &lt;input type="text" value="&lt;#= item.Price#&gt;" id="Edit.Price" name="Edit.Price" /&gt;
      &lt;/td&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>The values are obviously filled in via the json that is passed in.</p>
  
  <p>I should also mention that I am using the xval validation framework, which basically automatically generates the jquery validate rules for me: <a href="http://blog.codeville.net/2009/01/10/xval-a-validation-framework-for-aspnet-mvc/" rel="nofollow noreferrer">http://blog.codeville.net/2009/01/10/xval-a-validation-framework-for-aspnet-mvc/</a></p>