How to update multiple fields using ajax? In content type there are three field . Each field are node reference to different content. Here I want to restrict value and create dependency on these field. 
For example: I have one auto complete field "Country". On change of "Country", select list(i.e. State) field value is updated. On change of "State", "county" field is updated.
Everything is working fine. 

When I change value of "Country", "State" value get change But "county" value hold previous value. How should I achieve this. How should I reset value of county

My code snippet is like

function module_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['field_country'][LANGUAGE_NONE]['#ajax'] = array(
    'callback' =&gt; '_state_list_callback',
    'event'    =&gt; 'change',
    'wrapper' =&gt; 'state-list',
    'progress' =&gt; array('type' =&gt; 'throbber', 'message' =&gt;  'Please wait...'),
);
  $form['field_country']['#prefix'] = '&lt;div id="state-list"&gt;';
  $form['field_country']['#suffix'] = '&lt;/div&gt;';

  $form['field_state'][LANGUAGE_NONE]['#ajax'] = array(
    'callback' =&gt; '_county_list_callback',
    'event'    =&gt; 'change',
    'wrapper' =&gt; 'county-list',
    'progress' =&gt; array('type' =&gt; 'throbber', 'message' =&gt;  'Please wait...'),
);
  $form['field_county']['#prefix'] = '&lt;div id="county-list"&gt;';
  $form['field_county']['#suffix'] = '&lt;/div&gt;';
}


function _county_list_callback(&amp;$form, &amp;$form_state) {
  return $form['field_county'];
}

function _state_list_callback(&amp;$form, &amp;$form_state) {
  return $form['field_state'];
}
You can use ajax_command_replace() when replacing more than one element/field. Check this ans. The answer says as:


  Instead of returning the HTML of the single element to update, your
  ajax callback can return an array of ajax commands. So it can return
  two ajax_command_replace to replace each element.