title: Multiple WTForm fields from same form class in HTML table?
body: <p>I'm struggling to figure out how to accomplish unique form field instances that are associated with another element in a table. For a contrived example, here's the following code:</p>
  
  <pre><code>from flask import Flask, render_template, request
  from flask.ext.wtf import Form
  from wtforms import TextField, BooleanField
  
  app = Flask(__name__)
  
  app.debug = True
  app.config['SECRET_KEY'] = 'secret'
  
  class Person(Form):
      fname = TextField('First Name')
      phone = TextField('Phone Number')
      email = TextField('Email Address')
      active = BooleanField('Active')
  
  @app.route("/", methods=['GET', 'POST'])
  def guest():
      names = ['Bob', 'Joe', 'Jason', 'John'] # this could be a list, or data returned from a db query, previous POST data, or whatever
      form = Person()
      if request.method == 'POST' and form.validate_on_submit():
          return str(form.data)
  
      return render_template('index.html', names=names, form=form)
  
  if __name__ == "__main__":
      app.run(host='0.0.0.0')
  </code></pre>
  
  <p>My template:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form action="" method="post"&gt;
  &lt;table border="1"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;Telephone Number&lt;/th&gt;
              &lt;th&gt;Email Address&lt;/th&gt;
              &lt;th&gt;Active&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          {% for n in names %}
          &lt;tr&gt;
              &lt;td&gt;{{ n }}&lt;/td&gt;
              &lt;td&gt;{{ form.phone }}&lt;/td&gt;
              &lt;td&gt;{{ form.email }}&lt;/td&gt;
              &lt;td&gt;{{ form.active }}&lt;/td&gt;
          &lt;/tr&gt;
          {% endfor %}
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>
  
  
  </p>
  
  <p>It's obvious that in the HTML, the <code>name</code> parameters for each input element in each table row are all identical, because the same form field is being used, so on "POST", if one enters a phone number, that phone number is now populated for all the name rows in the table. Same goes for the "Activate" checkbox. I've also tried generating a list of form instances and passing that list into the template, but it doesn't appear to be working as I expected it would. It would seem as though my options at this point are:</p>
  
  <ol>
  <li>Don't use WTForms for this (see note below)</li>
  <li>Use the WTForms FieldList + FormField (I don't think this would work either as these require named keys vs arbitrary keys so I'd run into the exact same issue.)</li>
  <li>Use HiddenFields in some fashion (Haven't even thought of how this would work).</li>
  </ol>
  
  <p>I'm aware that I can just create the <code>&lt;input type&gt;</code> elements into the table manually via the template and assign them different names/id's based on <code>w</code> but this doesn't feel very idiomatic, plus I'd have to code in the validation on my own.</p>