title: How to show wtform validation error on modal
body: <p>I have a WTF Form inside a Twitter Bootstrap 3 modal, which I need to validate. The problem is that the modal closes when the user submits the form, even if there are validation errors. If I click on the button that triggers the modal again, the validation error is displayed. So my question is, how do I get the modal to stay open when there are validation errors?
  Thanks!</p>
  
  <pre><code>&lt;button type="button" class="btn btn-default" data-toggle="modal" role="dialog" data-target="#save"&gt; 
  &lt;span class="glyphicon glyphicon-flash"&gt;&lt;/span&gt;
  &lt;/button&gt;
  
  
  &lt;div class="modal fade" id="save" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
  &lt;div class="modal-dialog"&gt;
    &lt;div class="modal-content"&gt;
     &lt;div class="modal-header"&gt;
       &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
       &lt;h3 class="modal-title" id="myModalLabel"&gt;Archive List and Start New&lt;/h3&gt;
      &lt;/div&gt;
  
     &lt;form role="form_list" class="form form-medium" action="." method="post"&gt;
     {{ form_save.csrf_token }}
      &lt;div class="modal-body"&gt;    
          &lt;h4&gt;Save list as: &lt;/h4&gt;
          {{ render_field(form_save.list_name, class="input-large") }}
      &lt;/div&gt;
  
      &lt;div class="modal-footer"&gt;
          &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
          &lt;a href="#"&gt;
            &lt;button class="btn btn-success"&gt;Archive List&lt;/button&gt;&lt;/a&gt; 
      &lt;/div&gt;
    &lt;/form&gt;
  
    &lt;/div&gt;&lt;!-- modal content --&gt;
    &lt;/div&gt;&lt;!-- modal-dialog --&gt;
  &lt;/div&gt;&lt;!-- modal --&gt;
  
  
  &lt;script src="{{ url_for('static', filename='js/jquery.js') }}"&gt;&lt;/script&gt;
  &lt;script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"&gt;&lt;/script&gt;
  </code></pre>