title: Unable to add jQuery validation for dynamically generated input fields?
body: <p>I have a few input fields which are generated dynamically upon a button click based on the click event in jQuery. I am trying to add client side validation to those input fields.</p>
  
  <p>But the problem is, as the user can add any number of input fields dynamically, the id &amp; name of the input fields are different. It's done that way so as to fetch values in server side easily.</p>
  
  <p>So on the first click, the id &amp; name of the input fields will be company_name0, emp0, offc_email0 respectively. On the second click it will add a new set of input fields along with the already existing fields &amp; the name &amp; id will become  company_name1, emp1, offc_email1 &amp; so on.</p>
  
  <p>Validation code:</p>
  
  <pre><code>$('#frm_members').validate(
   {
    rules: {
      company_name: {
           required: true
        }, 
       emp :{
            number:true
       },
  
      offc_email:{
          email: true
      }
     }
  }); 
  </code></pre>
  
  <p>Here's a <a href="http://jsfiddle.net/iamsajeev/2hv8dpz7/" rel="nofollow">fiddle</a> which contains a partial working demo &amp; has html &amp; other necessary jquery code necessary for dynamic generation of fields.</p>