title: wtforms hidden field value
body: <p>I am using WTForms, and I have a problem with hidden fields not returning values, whereas the docs say they should.  Here's a simple example:</p>
  
  <p><strong>forms.py:</strong></p>
  
  <pre><code>from wtforms import (Form, TextField, HiddenField)
  
  class TestForm(Form):
      fld1 = HiddenField("Field 1")
      fld2 = TextField("Field 2")
  </code></pre>
  
  <p><strong>experiment.html:</strong></p>
  
  <pre><code>{% from "_formshelper.html" import render_field %}
  &lt;html&gt;
      &lt;body&gt;
          &lt;table&gt;
          &lt;form method=post action="/exp"&gt;
              {% for field in form %}
                  {{ render_field(field) }}
              {% endfor %}
              &lt;input type=submit value="Post"&gt;
          &lt;/form&gt;
          &lt;/table&gt;        
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>(render_field just puts the label, field and errors in td tags)</p>
  
  <p><strong>experiment.py:</strong></p>
  
  <pre><code>from flask import Flask, request, render_template
  
  from templates.forms import *
  from introspection import *
  
  app = Flask(\__name__)                  
  app.config.from_object(\__name__)
  db_session = loadSession()
  
  @app.route('/exp', methods=['POST', 'GET'])
  def terms():
      mydata = db_session.query(Peter).one()
      form = TestForm(request.form, mydata)
      if request.method == 'POST' and form.validate():
          return str(form.data)
      return render_template('experiment.html', form = form)
  
  if __name__ == '__main__':
      app.run(debug = True)  
  </code></pre>
  
  <p>mydata returns the only row from a table that has 2 fields, fld1 and fld2.  fld1 is an integer autoincrement field. The form is populated with that data, so if I run experiment.py, when I submit the form I get:</p>
  
  <p>{'fld2': u'blah blah blah', 'fld1': u'1'}</p>
  
  <p>But if I change fld1 to HiddenField, when I hit submit, I get:
  {'fld2': u'blah blah blah', 'fld1': u''}</p>
  
  <p>What am I doing wrong?</p>