Form API ajax add group of users and numbers
You just have to move the $i value.

Instead of

for ($i = 0; $i &lt; $form_state['num_names']; $i++) {
            $form['options']['number'][$i] = array(
                '#type' =&gt; 'textfield',
                '#title' =&gt; t('number:'),
            );
            $form['options']['Name'][$i] = array(
                '#type' =&gt; 'textfield',
                '#title' =&gt; t('Name of user:'),
            );
  }


Use

for ($i = 0; $i &lt; $form_state['num_names']; $i++) {
            $form['options'][$i]['number'] = array(
                '#type' =&gt; 'textfield',
                '#title' =&gt; t('number:'),
            );
            $form['options'][$i]['Name'] = array(
                '#type' =&gt; 'textfield',
                '#title' =&gt; t('Name of user:'),
            );
  }