title: jQuery: Problem with submission of dynamic form elements
body: <p>I'm trying to submit a form which contains dynamic elements that were added to the DOM by jQ after the page has completed loading. </p>
  
  <p>When I run a serialize() on the form, it's grabbing the data for all fields that are hardcoded into the page - but not the dynamic fields.</p>
  
  <p>Here are some code snippets of the same..</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form id="someform" name="someform" method="post" action""&gt;
      &lt;input type="text" name="afield" /&gt;
   &lt;ul id="somelist"&gt;
   &lt;/ul&gt;
   &lt;input type="submit" name="submit" /&gt;
  &lt;/form&gt;
  
  &lt;img id="add" src="add-button.png" /&gt;
  
  &lt;div class="new_unit" style="display:none"&gt;
   &lt;input type="text" name="somefield" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>JavaScript</strong>    </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  // Adds a new field to the form
  $( '#add' ).click( function() {
   $( '#somelist' ).append( '&lt;li&gt;' + $( '.new_unit' ).html() + '&lt;/li&gt;' );
  });
  
  // Validate before submission
  $( '#someform' ).validate({
   .......,
   .....,
   submitHandler: submit_form
  });
  
  function submit_form() {
   _data = $( '#someform' ).serialize();
   alert( _data );
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Upon hitting the submit button, data in the static field, <strong>afield</strong> is showing up... but any of the <strong>somefields</strong> added by jQuery aren't.</p>
  
  <p>I found a couple of <a href="https://stackoverflow.com/questions/1898508/jquery-ajax-form-and-dynamically-created-form-elements-not-submitting">similar questions</a> here. I'm complying to the suggested solution yet no effect.</p>
  
  <p>I'm using the latest jQuery (1.4.1) - and have considered playing with the live() event binder. I have a feeling that may help solve this issue, but cannot figure out how to use it in conjunction with the validate() plugin.</p>
  
  <p>Any suggestions ?</p>
  
  <p>Thanks,
  m^e</p>