title: Submitting modal form via Ajax
body: <p>I have a normal form for my question entity.</p>
  
  <p>Within that form is a modal form which allows users to add additional tags for their question.</p>
  
  <p>Here is an image of my modal form:</p>
  
  <p><img src="https://i.stack.imgur.com/lJ6vS.png" alt="enter image description here"></p>
  
  <p>Here is my twig template for my modal form:</p>
  
  <pre><code>&lt;div id="mymodal" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" 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;h4 class="modal-title" id="myModalLabel"&gt;Add New Tag&lt;/h4&gt;
          &lt;/div&gt;
          &lt;form class="tagForm" id="tag-form" action="{{ path('addTag') }}" method="post" enctype="multipart/form-data"&gt;
              &lt;div class="modal-body"&gt;
                  &lt;label for="tagName"&gt;Tag Name: &lt;/label&gt;
                  &lt;input id="tagName" class="form-control" type="text"/&gt;
  
              &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;input id="tag-form-submit" type="submit" class="btn btn-primary" value="Add Tag"&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>Script for viewing my modal form:</p>
  
  <pre><code>$('#addTag').click(function(e) {
          e.preventDefault();
          $('#mymodal').modal();
      });
  </code></pre>
  
  <p>Script for my modal form submission:</p>
  
  <pre><code>$(function() {
  
      $('#tag-form').submit(function() {
          $.ajax({
              type: "POST",
              url: "{{ path('addTag') }}",
              data: $('form.tagForm').serialize(),
              success: function(response) {
                  alert(response['response']);
              },
              error: function() {
                  alert('Error');
              }
          });
          return false;
      });
  });
  </code></pre>
  
  <p>My problem is that everytime I click the add tag button, all the forms including the question form is also submitted.</p>
  
  <p>What I really want is just to submit the modal form.</p>