title: Grouping HTML Input Fields in Flask
body: <p>I have an HTML form that accepts an arbitrary number of books and their authors.  I'm trying to group the corresponding books and authors so that it's easily parsed by the server when the user submits the form.  I tried using the HTML fieldset, but I'm not certain if that's the right approach.</p>
  
  <p>When I submit the form to the server there's no notion of the fieldset in Flask's <code>request.form</code> </p>
  
  <p>Here's the HTML form:</p>
  
  <pre><code>&lt;form action="/save/" method="POST"&gt;
  
      &lt;fieldset&gt;
          &lt;input name="author" value="Mark Twain" class="author" type="text"&gt;
          &lt;input name="book" value="The Adventures of Tom Sawyer" class="book" type="text"&gt;        
      &lt;/fieldset&gt;
  
      &lt;fieldset&gt;
          &lt;input name="author" value="Henry David Thoreau" class="author" type="text"&gt;
          &lt;input name="book" value="Civil Disobedience" class="book" type="text"&gt;        
      &lt;/fieldset&gt;
  
      &lt;!--More books and authors here possibly--&gt;
  
      &lt;button type="submit"&gt;Save&lt;/button&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>And here's what I see on the server when I log <code>request.form</code>:</p>
  
  <pre><code>ImmutableMultiDict([('book', u'The Adventures of Tom Sawyer'), ('book', u'Civil Disobedience'), ('author', u'Mark Twain'), ('author', u'Henry David Thoreau')])
  </code></pre>
  
  <p>You can see that the data the server receives has no notion of the fieldset or grouping of any sort.</p>
  
  <p>Is there a better way to group the individual books with their corresponding authors?  I'd prefer to do all of this in HTML rather than involve jQuery/JSON/AJAX.  </p>