Get content of selected option after user select any option from select field
I have done same with User Roles and Users. Check below code if you can find it helpful.

function custom_menu(){
    $items = array();
    $items['custom'] = array(
        'title' =&gt; 'custom',
        'description' =&gt; 'Custom',
        'page callback' =&gt; 'drupal_get_form',
        'page arguments' =&gt; array('custom_form'),
        'access callback' =&gt; TRUE,
    );

    // " % " is the RID coming from '#autocomplete_path'.
    $items['autocomplete/%'] = array(
        'page callback' =&gt; 'autocomplete_callback',
        'page arguments' =&gt; array(1),
        'access callback' =&gt; TRUE,
    );
    return $items;
}


function custom_form($form, &amp;$form_state){  
    $options = array(); 
    $roles = user_roles($membersonly = TRUE); // Getting list of Roles.

    // Removed "Authenticated" role from the list. 
    // That is not listed in "users_roles" Table.
    array_shift($roles); 

    foreach ($roles as $key =&gt; $value) {
        $rid = user_role_load_by_name($value);
        // Give RID to each role as their key in array.
        $options[$rid-&gt;rid] = $value; 
    } 

    // Defining $role as selected value of Select list.
    $role = !empty($form_state['values']['roles']) ? $form_state['values']['roles'] : '';

    $form['roles'] = array(
        '#type' =&gt; 'select',
        '#title' =&gt; 'Role',
        '#options' =&gt; $options,
        '#ajax' =&gt; array(
            'wrapper' =&gt; 'auto-wrapper',
            'callback' =&gt; 'select_callback',
        ),
    );

    $form['auto'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; 'Users',
        '#autocomplete_path' =&gt; 'autocomplete/' . $role, // Pass RID to path. 
        '#prefix' =&gt; '&lt;div id="auto-wrapper"&gt;',
        '#suffix' =&gt; '&lt;/div&gt;',
    );

    return $form;
}

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

function autocomplete_callback($role, $string = "") {
  $matches = array();
  if ($string) {
    $query = db_select('users', 'u');

    if(is_numeric($role) &amp;&amp; $role != ''){
        $query-&gt;join('users_roles', 'ur', 'ur.uid = u.uid');
    }

    $query-&gt;fields('u', array('name', 'uid'));

    if(is_numeric($role) &amp;&amp; $role != ''){
        $query-&gt;condition('ur.rid', $role)
            -&gt;fields('ur', array('rid'));
    }

    $query-&gt;condition('name', db_like($string) . '%', 'LIKE')
      -&gt;range(0, 10);

    $result = $query-&gt;execute();

    foreach ($result as $user) {
      $matches[$user-&gt;name] = check_plain($user-&gt;name);
    }
  }

  drupal_json_output($matches);
}