choose postal code and show city
<p>My project group got this problem in a formula.</p>

<p>We have a select option where postal code/ZIP code is chosen for our country, 
and then we want the city attached to the postal/ZIP code shown in a text field next to the <code>&lt;select&gt;</code>. </p>

<p>Our teacher is telling us to write some JavaScript that loops out an array from the PHP table. Then, when the postal/ZIP code is chosen, some more JS finds the matching city.</p>

<p>Here's some of the code, that we <em>of course</em> need changed!</p>

<pre><code>&lt;select id="postnr_option"&gt;
    &lt;option value="" disabled selected&gt;postnr&lt;/option&gt;
    &lt;?php getpostnr($dbh); ?&gt;
&lt;/select&gt;
&lt;input name="postdistrikt" type="text" class="required" id="postdistrikt" title="" placeholder="her kommer postdistrikt" size="30"&gt;
</code></pre>

<p>We hope you understand our problem and hopefully can find us a solution.</p>
