Is there a way to set `selected` flag instead of val() for dropdowns?
<p>The select values are confusing me. When the user edits a row in my app I clone a tag with jquery (called empty-X) and put it on a modal window so that the user can edit the values. At the same time I get a json object (data) from server and fill in the current fields on the modal window as it stands in the database :</p>

<pre><code>empty_X.find('#id_deals-1-currency').val(data[0].fields['currency']);
</code></pre>

<p>Now when the modal shows, the user can see how the correct currency is selected in the dropdown.</p>

<p>Yet when I check the HTML for this element with Firebug, I get a different picture, nothing seems selected.</p>

<pre><code>&lt;select id="id_deals-1-currency" name="deals-1-currency"&gt;
 &lt;option selected="selected" value=""&gt;---------&lt;/option&gt;
 &lt;option value="1"&gt;USD - $&lt;/option&gt;
 &lt;option value="2"&gt;EUR - €&lt;/option&gt;
 &lt;option value="3"&gt;GBP - £&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>And yet when I send the form to the server, there are no validation errors and the currency is the same value as it was previously set through val(). Life is good.</p>

<p>While this works by itself, there is a problem. What if the user wants to get back to the edit mode and verify the currency once more before saving it? </p>

<p>In this case I can't load the values from the database any more. His previous local changes matter now. I have to clone the current record with currency inside back in the modal window, so the user can see what he had changed previously and verify it. The problem is now the user doesn't see the currency he had changed in the previous step. In fact he would see an empty dropdown instead.</p>

<p>What are my options here? Is there a way to set the <code>selected</code> flag to the actual selection rather than using <code>val()</code>?</p>
