title: how do I add onchange="this.form.submit()" to a Flask/WTFoms HTML page
body: <p>I'm trying to make it so that when I change an input filed on the HTML page the form submits automatically. But the page is generated by Flask/WTForms and it won't let me insert onchange="this.form.submit()" as a parameter for when it builds the page. </p>
  
  <p>I'm new to coding and I've tried lots of things - but this problem is really elusive! </p>
  
  <p>Here is the Template HTML File</p>
  
  <pre><code>&lt;h5&gt;Give input part 1&lt;/h5&gt;
  {% from "_formhelpers.html" import render_field %}
  &lt;form id=myform method=post action=""&gt;
  &lt;table&gt;
      &lt;dl&gt;
          {{ render_field(form.A) }}
          {{ render_field(form.B) }}
      &lt;/dl&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>and the Helper Macro File (_formhelpers.html)</p>
  
  <pre><code>{% macro render_field(field) %}
  &lt;tr&gt;
  &lt;td&gt;{{ field.name }}&lt;/td&gt;
  &lt;td&gt;{{ field(size=20) }} &lt;/td&gt;
  &lt;td&gt;&lt;font color="blue"&gt;{{ field.label }}&lt;/font&gt;&lt;/td&gt;
  &lt;td&gt;{{ field.description | safe}}&lt;/td&gt;
  {% if field.errors %}
    &lt;td&gt;&lt;ul class=errors&gt;
    {% for error in field.errors %}
      &lt;li&gt;&lt;font color="red"&gt;{{ error }}&lt;/font&gt;&lt;/li&gt;
    {% endfor %}&lt;/ul&gt;&lt;/td&gt;
  {% endif %}
  &lt;/tr&gt;
  {% endmacro %}
  </code></pre>
  
  <p>and my Model</p>
  
  <pre><code>from   wtforms import Form, validators, IntegerField,
  
  class InputForm(Form):
      B = IntegerField(
          label='Integer', default=BB, description="this description",
          validators=[validators.NumberRange(0, 30)])
  </code></pre>
  
  <p>I just want </p>
  
  <pre><code>onchange="this.form.submit()"
  </code></pre>
  
  <p>to show up in the rendered HTML page like this! </p>
  
  <pre><code>&lt;p&gt;&lt;input id="B"  name="B"  type="text" onchange="this.form.submit()"  &gt; &lt;label for="B"&gt;Integer&lt;/label&gt;&lt;/p&gt;
  </code></pre>