title: Bootstrap Modal Form submit error
body: <p>I know this question has many solutions in SO.But still I cant spot my mistake.The following is my bootstrap modal form</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;title&gt;Bootstrap Example&lt;/title&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;link rel="stylesheet" href="assets/lib/bootstrap/css/bootstrap.min.css"&gt;
    &lt;script src="../asset/modal/js/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src="assets/lib/bootstrap/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;? if(isset($_POST["sendmail"]))
     echo "Form 1 have been submitted";
      ?&gt;
  &lt;div class="container"&gt;
  
    &lt;!-- Trigger the modal with a button --&gt;
  
    &lt;!-- Modal --&gt;
    &lt;div class="modal fade" id="myModal" role="dialog"&gt;
      &lt;div class="modal-dialog"&gt;
      &lt;? echo $token;  ?&gt;
        &lt;!-- Modal content--&gt;
        &lt;form class="form-horizontal" role="form" method="post" name="sendmail" &gt;
        &lt;div class="modal-content"&gt;
          &lt;div class="modal-header"&gt;
            &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
            &lt;h4 class="modal-title"&gt;Modal Header&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class="modal-body"&gt;
            &lt;textarea rows="8" class="form-control"&gt;&lt;/textarea&gt;
          &lt;/div&gt;
          &lt;div class="modal-footer"&gt;
            &lt;button type="submit" class="btn btn-default" &gt;Send&lt;/button&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;/form&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But whenever i submit the form it redirects to the index page of my project.Please Help me spotting my error.:-(</p>