title: WTForms with a variable amount of textareas
body: <p>I have a HTML form with my Flask application which includes a textarea however, the user can press a button which adds another textarea to the form to create an infinite amount of textareas.</p>
  
  <p>As I'm not using WTForms, validation is much harder and so I've done it on the client side with Javascript however anyone with programming skills can edit this code which is unsafe. I would prefer to validate the form with WTForms.</p>
  
  <p>Is this even possible to do with WTForms and Flask or would I have to create my own method with Flask and flashing messages to validate the form? Thanks.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form id="myForm"&gt;
    &lt;input type="text"&gt;
    &lt;textarea&gt;&lt;/textarea&gt;
    &lt;textarea&gt;&lt;/textarea&gt;
  &lt;/form&gt;
  &lt;button onclick="add()"&gt;Add textarea&lt;/button&gt;
  
  &lt;script&gt;
    function add() {
      var textarea = document.createElement('textarea');
      document.getElementById('myForm').appendChild(textarea);
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>So in my case, I also have an input at the beginning which I would like to validate. I would also like to validate that all the textareas so that they are not allowed to be empty.</p>
  
  <p>I would like to validate this with WTForms though to create a form with WTForms, it must be created in Python and then rendered in HTML. As textareas are added to the form, they cannot be validated as they are not defined in the python code to create the WTForms.</p>
  
  <p>The issue is, I would like to be able to add form elements to a form created with WTForms.</p>