title: How can I use a HiddenField to coerce integer data in WTForms?
body: <p>I have a <code>WTForm</code> class like so:</p>
  
  <pre><code>class MyForm(Form):
      field1 = HiddenField(default=0, validators=NumberRange(min=0, max=20)])
  </code></pre>
  
  <p>consider this markup as rendered by <code>WTForms</code></p>
  
  <pre><code>&lt;input type='hidden' name='field1' value='5'&gt;&lt;/input&gt;
  </code></pre>
  
  <p>This does not pass the <code>NumberRange</code> validation. This is because <code>HiddenField</code>s widget class coerces the <code>value</code> attribute into a string. How can I get <code>WTForms</code> to produce this markup  such that I can perform numeric validation on the subsequent <code>POST</code>?</p>