title: Dynamically change <textarea> depending on <select> in jinja2 / flask
body: <p>In my python file I have a dictionary 
  <code>results = {'Key1':'Value1', 'Key2':'Value2'}</code>. I passed it in <code>return render_template('pages/queries.html', results=results)</code></p>
  
  <p>Now in html I have </p>
  
  <pre><code>    &lt;select name="results"&gt;
          {% for key, value in results.items() %}
          &lt;option value="{{ key }}"&gt;{{ key }}&lt;/option&gt;
          {% endfor %}
      &lt;/select&gt;
      {% for value in results.values() %}
      &lt;textarea rows="10" cols="40" name="results"&gt; {{value}} &lt;/textarea&gt;
      {% endfor %}
  </code></pre>
  
  <p>This is unfortunately displaying three textareas for some reason. <strong>The desired result I want is someone selects a value from the dropdown (select html) and if they choose 'key2' then I want 'value2' to appear inside of textarea. If they choose 'key1' then dynamically I want textarea to update to 'value1'.</strong> But this isn't happening and I've tried changing the locations of all the jinja codes and variations and haven't figured it out, please help.</p>