how to make multiple ajax callbacks from a drop-down field? I have a select field in my custom module (Drupal 7), which needs to refresh the values of 2 different field types when a value is selected, firstly a checkbox field, which currently is refreshed correctly when am changing the dropdown value, and a text field, which is not changing, as it keeps the value from the first dropdown option by default.

Samples of my codes:

$form['webform_name'] = array(
'#type' =&gt; 'select',
...
#ajax' =&gt; array(
  'event' =&gt; 'change',
  'callback' =&gt; 'ajax_checkbox_callback',
  'method' =&gt; 'replace',
  'wrapper' =&gt; array('checkboxField','txtField'),
)

$form['checkboxField'] = array(    
'#type' =&gt; 'checkboxes',
...
'#prefix' =&gt; '&lt;div id="checkboxField"&gt;',
'#suffix' =&gt; '&lt;/div&gt;',

$form['txtField']=array(
'#type' =&gt; 'textfield',
...
'#prefix' =&gt; '&lt;div id="txtField"&gt;',
'#suffix' =&gt; '&lt;/div&gt;',


function ajax_checkbox_callback($form, &amp;$form_state) {
    return array(
    '#type' =&gt; 'ajax',
    '#commands' =&gt; array(
    ajax_command_replace("#checkboxField", render($form['checkboxField'])),
    ajax_command_replace("#txtField", render($form['txtField']))
    )
  ); 
}


How can I make the txtField field to clear and load the corresponding value every time I change my drop-down values?
In your ajax_command_replace where the form is rendered, do this: ajax_command_replace("#checkboxField", render($form['checkboxField']['values']=$text)), where $text is the value from the checkboxes, as shown below:



function ajax_checkbox_callback($form, &$form_state) {
    return array(
    '#type' => 'ajax',
    '#commands' => array(
    ajax_command_replace("#checkboxField", render($form['checkboxField']['values'] = $value_text_form_text_field_1)),
    ajax_command_replace("#txtField", render($form['txtField']['values'] = $value_text_form_text_field_2))
    )
  ); 
}