AJAX Replace on Select I've been trying to get an answer to the following question AJAX dependent select. However I think I'm compounding to many concepts. Perhaps I should first master the FAPI AJAX before building upon it. I can not get the following to work properly. After selecting an option I get the drupal clock like it's going to re-render the text field however nothing happens and the value does not change. Where am I going wrong?


function main_iosupload_form($form, &amp;$form_state) {
//Define SQL Lookup Query
  $sqlplatform = "SELECT vid, name FROM {taxonomy_vocabulary} WHERE vid &gt;= 4";

  $result = db_query($sqlplatform);
  $options = array();
    foreach ($result as $row) {
      $options[$row-&gt;vid] = t($row-&gt;name);
    }

$form['platform'] = array(
  '#type' =&gt; 'select',
  '#title' =&gt; t('Select a Platform'),
  '#options' =&gt; array(
    0 =&gt; t('- Select -')) + $options,
  '#default_value' =&gt;  0,
  '#required' =&gt; TRUE,
  '#ajax' =&gt; array(
    'callback' =&gt; 'ajax_select_callback',
    'wrapper' =&gt; 'replace_model_div',
    'effect' =&gt; 'fade',
   ),
);

$form['model_wrapper'] = array(
  '#type' =&gt; 'textfield',
  '#default_value' =&gt; (!empty($form_state['values']['platform']) ? $form_state['values']['platform'] : t("Intial Value")),
  '#prefix' =&gt; '&lt;div id="replace_model_div"&gt;',
  '#suffix' =&gt; '&lt;/div&gt;',
);

return $form;
}
function ajax_select_callback($form, $form_state) {
  return $form['model_wraper'];
}
Almost a whole week of hitting my head on this. Yeah it helps if in the callback function I call back the correct form name... sigh