form with ajax dosen't send values I have a custom form built that generates some fields based on a select box, 
the form works ok on user side. it loads new rooms when select changes.
the problem is that the globallink_ui_search_hotels in form[values]['hotels']['rooms'] it will only show room_0 even if you select 2 or more rooms.

update:
 from what i can see the after number of rooms changes, the generated select boxes dose not have a name attribute

  function globallink_ui_search_form($form, &amp;$form_submit){ // the form creation function
  //........
  $form['hotels']['nrrooms'] = array(
      '#multiple_toggle' =&gt; '1',
      '#type' =&gt; 'select',
      '#title'=&gt;t('Number of rooms'),
      '#options' =&gt; array(
        1=&gt;1,
        2=&gt;2,
        3=&gt;3,
        4=&gt;4,
        5=&gt;5,
        6=&gt;6,
        ),
      '#default_value'=&gt;1,
      '#ajax'=&gt;array(
        'callback'=&gt;'globallink_ui_rooms_change_callback',
        'wrapper'=&gt;'globallink-ui-rooms-change-wrapper',
        'effect' =&gt; 'slide',
        ),
      // '#title' =&gt; t('select departing time'),
    );

    globallink_ui_rooms_change_callback($form,$form_state);

  //....
    $form['hotels']['submit'] = array(
      '#weight' =&gt; '7',
      '#type' =&gt; 'submit',
      '#value' =&gt; t('FIND HOTELS'),
      '#submit' =&gt; array('globallink_ui_search_hotels')
    );

  }

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

    $nradults=array();
    for ($i=1; $i &lt; 10; $i++) { 
      $nradults[$i] = $i;
    }


     $form['hotels']['rooms'] = array(
        '#collapsed' =&gt; '0',
        '#type' =&gt; 'fieldset',
        '#collapsible' =&gt; '0',
        '#prefix' =&gt; '&lt;div id="globallink-ui-rooms-change-wrapper"&gt;',
        '#suffix' =&gt; '&lt;/div&gt;',
    );

    $nrrooms=!empty($form_state['values']) ? $form_state['values']['hotels']['nrrooms'] : 1;

    for($i = 0 ; $i&lt;$nrrooms;$i++){

      $form['hotels']['rooms']['room_'.$i] = array(      
          '#weight' =&gt; $i,
          '#title'=&gt;'Room '.($i+1),
          '#collapsed' =&gt; '0',
          '#type' =&gt; 'fieldset',
          '#collapsible' =&gt; '0',
      );

      $form['hotels']['rooms']['room_'.$i]['adults'] = array(
        '#required' =&gt; '1',
        '#default_value' =&gt; 1,     
        '#type' =&gt; 'select',
        '#title'=&gt;'Adults',
        '#options' =&gt; $nradults,
      );

      $form['hotels']['rooms']['room_'.$i]['infants'] = array(
        '#required' =&gt; '1',
        '#default_value' =&gt; 1,
        '#type' =&gt; 'select',
        '#title'=&gt;'Infants',
        '#options' =&gt; $nradults,
      );
    }

    return $form['hotels']['rooms'];
  }

  function globallink_ui_search_hotels($form, &amp;$form_state){
    dpm($form_state['values'],'search hotels');
  }
You need to place 

 $form['hotels']['rooms'] = array(
    '#collapsed' =&gt; '0',
    '#type' =&gt; 'fieldset',
    '#collapsible' =&gt; '0',
    '#prefix' =&gt; '&lt;div id="globallink-ui-rooms-change-wrapper"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
);


in globallink_ui_search_form function. The wrapper tag must be loaded before callback send.