title: javascript: form select option and input field
body: <p>I have an form <code>input</code> field, when a user types &quot;text 2&quot;, I want that &quot;text 2&quot; selected in the form <code>select</code>:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;select id=&quot;formsel&quot;&gt;
      &lt;option value=&quot;text 1&quot;&gt;text 1&lt;/option&gt;
      &lt;option value=&quot;text 3&quot;&gt;text 2&lt;/option&gt;
      &lt;option value=&quot;text 3&quot;&gt;text 3&lt;/option&gt;
  &lt;/select&gt;
  &lt;input type='text' id='input' /&gt;
  </code></pre>
  <p>I get the value from the <code>input</code> like this:</p>
  <pre><code>var input_val = document.getElementById('input').value; 
  </code></pre>
  <p>But I can not select the option from the dynamic form <code>select</code> with</p>
  <pre><code>document.form.formsel.value = input_val;
  </code></pre>
  <p>Can anyone see what I'm doing wrong?</p>