AJAX dependent select
A few problems I can see:


The $model_options variable is used both in the form and AJAX callback function, but isn't defined anywhere. Same thing with the $platform variable in the AJAX callback.
You're putting a wrapper around a particular element, but instead of returning that element you're returning the entire form.
It looks like you're attempting to put form-altering logic into the AJAX callback function - it should be used only to return the updated element, the actual building of it should be done in the form function.
You're defining the AJAX callback wrapper as 'replace_model_div', and implementing it as a class name instead of an ID, and with a complete different name (model-wrapper).
The function signature for your form is wrong (in Drupal 7 it's: 

function form_name($form, &amp;$form_state)



You should get some joy with code a bit more like this:

function main_iosupload_form($form, &amp;$form_state) {
  //Define SQL Lookup Query

  $sqlplatform = "SELECT vid, name FROM {taxonomy_vocabulary} WHERE vid &gt;= 4";
  $sqlmodel = "SELECT tid, name FROM {taxonomy_term_data}";

  $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; isset($form_state['values']['platform']) ? $form_state['values']['platform'] : 0,
    '#required' =&gt; TRUE,
    '#ajax' =&gt; array(
      'event' =&gt; 'change',
      'callback' =&gt; 'ajax_select_callback',
      'wrapper' =&gt; 'replace_model_div',
      'method' =&gt; 'replace',
     ),
  );

  if (isset($form_state['values']['platform'])) {
    $model_options = function_to_get_model_options_by_platform($form_state['values']['platform']);

    $form['model_wrapper'] = array(
      '#prefix' =&gt; '&lt;div id="replace_model_div"&gt;',
      '#suffix' =&gt; '&lt;/div&gt;',
    );

    $form['model_wrapper']['model'] = array(
      '#type' =&gt; 'select',
      '#title' =&gt; t('Select a Model'),
      '#options' =&gt; $model_options,
    );
  }

  return $form;
}

function ajax_select_callback($form, $form_state) {
  return $form['model_wrapper'];
}