title: How to Submit Form into Bootstrap Modal (send POST method into Modal) Laravel
body: <p>I have been trying for 2 days but still no luck!</p>
  
  <p>I want to</p>
  
  <ul>
  <li>Submit Form from index.php to result.php</li>
  <li>Show result.php inside Modal while index.php is open! (without
  closing index.php)</li>
  </ul>
  
  <p>here is example code!</p>
  
  <blockquote>
    <p>index.php</p>
  </blockquote>
  
  <pre><code>&lt;form id="myform" method="post" action="result.php" target="_blank"&gt;
  &lt;input type="text" name="userId" id="userId"/&gt;
  &lt;input id="button" type="submit"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <blockquote>
    <p>result.php</p>
  </blockquote>
  
  <pre><code>    &lt;div id="resultModal" class="modal fade" tabindex="-1"&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;
                   &lt;i class="fa fa-times-circle"&gt;&lt;/i&gt;ESC&lt;/button&gt;
                   &lt;h4 class="modal-title"&gt;Show Result &lt;/h4&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
  
  
  
              &lt;/div&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
     &lt;/div&gt;
  </code></pre>
  
  <p>In Modal body </p>
  
  <pre><code>&lt;?php  $selectedId = $_POST['userId']; 
      echo  $selectedId; 
  ?&gt;
  </code></pre>
  
  <p>And JQuery</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      $('#myForm').on('submit', function(ev) {
          var userId = $('#userId').find("input").val();
          $.ajax({
              type: 'POST',
              url : $(this).attr('action'),
              data: userId,
              success: function () {
                // alert('form was submitted');
              }
            });
  });
  &lt;/script&gt;
  </code></pre>