AJAX form default values
Loop through the myValues (only use the foreach if you are not already in a for loop) and use the appropriate array element:

foreach($myValues as $index =&gt; $name) {
  $form['names_fieldset']['name'][$index] = array( // Already using $i here. Are you in a for loop?
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Name'),
    '#default_value' =&gt; $name, // Or $myValues[$i]['name'] if you are already in a for loop (it looks like you might be).
  );
}


Depending on the structure of the array you may have to change this a little. If these don't work and you can't figure it out, add a print out of one of your smaller arrays using print_r to your question and we can help.