How to add a button "Add More" with ajax for adding multiple fields?
In your form function, group the textfields under a key, you can define your own key. I use group here.

// Create wrapper for ajax
$form['group']['#prefix'] = '&lt;div id="form-wrapper"&gt;';
$form['group']['#suffix'] = '&lt;/div&gt;';

for ($i = 0; $i &lt; $form_state['num_names']; $i++) {

  $form['group']['name_' . $i] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Name')
  );
}


In your ajax callback, return part of the form.

function ajax_add_col($form, &amp;$form_state){

  $form_state['num_names']++;

  // rebuild whole form with new values
  $form_state['rebuild'] = true;

  return $form['group'];
}