Add fields to form dynamically with ajax and retrieve values
Dont set any field #required to true.

 $form['markup'] = array(
        '#type' =&gt; 'markup',
        '#prefix' =&gt; '&lt;div id="my-wrapper"&gt;',
        '#suffix' =&gt; '&lt;/div&gt;',
    );
 $form['markup']['myfield'] = array(
        '#type' =&gt; 'textfield', 
        '#size' =&gt; 12,
    );