How to fill form fields based on other fields values using AJAX
I had the same issue and this workaround did the trick. 
Basically you clear up $form_state['input'] value and rebuild the form. 

Form builder:

&lt;?php 
$form['test'] = array(
  '#type' =&gt; 'textfield', 
  '#title' =&gt; t('Test'),
  '#ajax' =&gt; array(
    'callback' =&gt; 'my_test_callback_func',
    'wrapper' =&gt; 'edit-test2',
    'progress' =&gt; array(
      'message' =&gt; '',
      'type' =&gt; 'throbber',
    ),
  ),
);

$form['test2'] = array(
  '#type' =&gt; 'textfield', 
  '#prefix' =&gt; '&lt;div id="edit-test2"&gt;',
  '#suffix' =&gt; '&lt;/div&gt;', 
  '#title' =&gt; t('Test2'),
);
?&gt;


Ajax callback function:
This is the trickier part. 

&lt;?php 
function my_test_callback_func($form, &amp;$form_state) {
  unset($form_state['input']['test2'], $form_state['values']['test2']);
  $form['test2']['#default_value'] = 'Auto Filled!';
  $form_state['input']['test2'] = 'Auto Filled!';
  return form_builder($form['#id'], $form['test2'], $form_state);
}
?&gt;


We unset the user input (or check if it's empty), set a default value and then rebuild the form.