<p>I understand. However, I&#39;m not setting the default value directly from db_query. I&#39;m setting it as you suggested, but I&#39;m not seeing the correct result. That is the issue. Even though I&#39;m setting it as everyone has suggested, I&#39;m still not seeing them selected by default. </p>

<p>I also understand that I should run the submitted values through array_filter.  That&#39;s not the issue. </p>
<p>Let me know if or how I should file a bug report. </p>
<p>Thanks, </p>
<p>Shawn </p>
<p>Sent from my Android device. please forgive any spelling or grammatical errors.</p>
<div class="gmail_quote">On Jan 12, 2012 3:48 PM, &quot;Metzler, David&quot; &lt;<a href="mailto:metzlerd@evergreen.edu">metzlerd@evergreen.edu</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
PS.<br>
<br>
IT&#39;s important to know that what you get back in your submit handler for<br>
$formstate[&#39;values&#39;][&#39;new_server&#39;]is an array of all of the servers and<br>
wheter they are selected.  In the case where SERVER01 and SERVER02 are<br>
selected you&#39;ll get back the array:<br>
<br>
Array(<br>
  &#39;SERVER01&#39; =&gt; &#39;SERVER01&#39;,<br>
  &#39;SERVER02&#39; =&gt; &#39;SERVER02&#39;,<br>
  &#39;SERVER03&#39; =&gt; 0,<br>
  &#39;SERVER04&#39; =&gt; 0,<br>
  &#39;SERVER05&#39; =&gt; 0<br>
);<br>
<br>
You will not get back string data as your code seems to be expecting.<br>
<br>
Dave<br>
<br>
<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:support-bounces@drupal.org">support-bounces@drupal.org</a> [mailto:<a href="mailto:support-bounces@drupal.org">support-bounces@drupal.org</a>] On<br>
Behalf Of Shawn Webb<br>
Sent: Thursday, January 12, 2012 2:18 PM<br>
To: <a href="mailto:support@drupal.org">support@drupal.org</a><br>
Subject: [support] Setting Multiselect Default Values<br>
<br>
Hey Fellow Drupalers,<br>
<br>
I&#39;m trying to set the &#39;#default_value&#39; property to a select form<br>
element that has &#39;#multiple&#39; set to TRUE. Below you will find a link<br>
to the source and a link to a screenshot. I&#39;ve tried setting<br>
&#39;#default_value&#39; to:<br>
<br>
[values]<br>
array(&#39;SERVER01&#39;)<br>
array(&#39;SERVER01&#39; =&gt; &#39;SERVER01&#39;)<br>
array(1)<br>
array(&#39;1&#39;)<br>
1<br>
&#39;SERVER01&#39;<br>
[/values]<br>
<br>
But nothing sets the default value of the select form element. The<br>
&#39;#options&#39; element is set to (verbatim from var_export): array (<br>
&#39;SERVER01&#39; =&gt; &#39;SERVER01&#39;, &#39;SERVER02&#39; =&gt; &#39;SERVER02&#39;, &#39;SERVER03&#39; =&gt;<br>
&#39;SERVER03&#39;, &#39;SERVER04&#39; =&gt; &#39;SERVER04&#39;, &#39;SERVER05&#39; =&gt; &#39;SERVER05&#39;, )<br>
<br>
Links:<br>
Screenshot: <a href="http://t.co/vVAcT4fA" target="_blank">http://t.co/vVAcT4fA</a><br>
Code: <a href="https://t.co/ETl4MtgV" target="_blank">https://t.co/ETl4MtgV</a><br>
<br>
The code in question is line 105 of vulnscan.admin.inc<br>
<br>
Let me know what I should do. I&#39;m running drupal 7.11-dev (git<br>
checkout of Drupal codebase, set to the 7.x branch).<br>
<br>
Thanks,<br>
<br>
Shawn<br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</blockquote></div>