title: Validate dynamically generated input box with dynamic ID and name
body: <p>I have a button that adds two input field onclick. Below is the code:</p>
  
  <pre><code>&lt;button type="button" class="btn btn-warning btn-xs" id="additem"&gt;
  Click here to add Items&lt;/button&gt;
  &lt;form&gt;
  &lt;div id="inputboxes"&gt;&lt;/div&gt;
  &lt;input type="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and JQuery is</p>
  
  <pre><code>var i = 1,
      j = 1,
      k = 1,
      l = 1;
  $("#additem").click(function () {
      $("#inputboxes").append("&lt;div class='form-group'&gt;&lt;input type='text' id='iname" +
          (j++) +
          "' name='iname" +
          (i++) +
          "' class='form-control'  placeholder='Enter Item Name' required='required'/&gt;&lt;/div&gt; " +
          "&lt;div class='form-group'&gt;&lt;input type='text' id='iprice" +
          (k++) +
          "'   name='iprice" +
          (l++) +
          "' class='form-control'  placeholder='Enter Item Price' required='required'/&gt;&lt;/div&gt;");
  })
  </code></pre>
  
  <p>How can i validate these dynamically added input boxes for empty and correct values on submitting the form?</p>