How to change Selected Index when I only have the name?
<p>I'm integrating Postcode anywhere with my web project. I'm using a drop drop for the county/state field. Postcode anywhere returns the name of the County. Can I change the Selected Index when I only have the name? (I'm using a number for the value field which relates to a database field).</p>

<p>I tried the following:</p>

<pre><code>var f = document.getElementById("state_dropdown");
f.options.[f.selectedIndex].text = response[0].County;
</code></pre>

<p>I've tried to include the drop down code html here but I can't get it to work properly for some reason. </p>

<p>But of course this just changes the text field for the item in the drop down that is already selected.</p>

<p>I can query the database and find out what ID I have assigned the county but I'd rather not if there is another way.</p>
