Form type select with multiple values I have a form field with type select. The results values are taken from the database.
If the select list is with single value I'm displaying the value title on the submit like this:

   $selected_index = $form_state['values']['select_list']; //the field is select_list
   $display_value = form['select_list']['#options'][$selected_index];
   dpm($display_value); //it's showing the selected option value title.


When I'm using '#multiple' =&gt; TRUE; into the form field, It's showing error: Warning: Illegal offset type in...

How can I display the titles of the multiple values?

EDIT:

This is my code:

function mymodule_page($form, &amp;$form_state) {

global $user; 

$result = db_query('SELECT n.nid, n.title, n.created
FROM {node} n WHERE n.uid = :uid and type = :type', array(':uid' =&gt; $user-&gt;uid, ':type' =&gt; 'outlets'));

$droplist = array();
foreach($result as $record) {
    $title = $record-&gt;title;
    array_push($droplist, $title); 

    $form['select_list'] = array(
       '#type' =&gt; 'select',
       '#title' =&gt; 'Select list',
       '#options' =&gt; $droplist, //I'm getting this list from my database
       '#multiple' =&gt; TRUE,   
   );
}

function mymodule_submit($form, &amp;$form_state) {
   $selected_index = $form_state['values']['select_list'];

   foreach($selected_index as $key =&gt; $sindex)
   dpm($sindex);
}
In case of multiple values, the return value is an array of all selected values. Therefore, $selected_index is now an array and not a string.