Can I autoselect a drop down menu?
<p>I am taking text from a table via an autocomplete to pre-load information that was set to the table the last time the user was in it.  I can get the information without any problem.  Here is the jquery/javascript code that I am having the hard time with:</p>

<pre><code>    $('#type').val(ui.item.type); 
    var t = $("#type").val();
    $('#types').text(t);
</code></pre>

<p>Here is the HTML code for the drop down menu:</p>

<pre><code>    &lt;label for="type"&gt;&lt;strong&gt;*&lt;/strong&gt;Tournament Type&lt;/label&gt;
        &lt;select name="type" id="type"&gt;
        &lt;option value=""&gt;Please select...&lt;/option&gt;&lt;?
                                                    while ($type = mysql_fetch_array($types)) {
        $TID = $type['ID'];
        $name = htmlspecialchars($type['Type']);
        echo("&lt;option value = '$name'&gt;$name&lt;/option&gt;\n");
                                                    }?&gt;
        &lt;/select&gt;
</code></pre>

<p>What I am trying to accomplish here is to make the displayed item on my drop down menu equal to what was previously selected while still maintaining the functionality of the drop down menu in case the information needs to be changed.  I have not been able to get this to work thus far.  Can I do this or is there another method I should be using to accomplish this?</p>
