Bootstrap Modal Submit form
<p>I've been searching all over and trying different combinations. I will try to explain exactly what I need. I have a table populated with SQL data, last column is an Edit button to open a bootstrap modal. I've been able to populate the table and create the edit button to pass the row id into the modal for the query on the modal populate all inputs with actual data on DB. Everything is working. But now I can't even make a POST on the form, I hit the button and nothing happens.</p>

<pre><code>&lt;?php 
require 'style/header.php';
require 'core/db_connect.php';
?&gt;&lt;div class="main"&gt;
            &lt;div class="row"&gt;
                &lt;table class= "table table-striped table-bordered table-hover"&gt;
                    &lt;thead&gt;
                        &lt;tr&gt;
                            &lt;th colspan="1" rowspan="1" style="width: 180px;" tabindex="0"&gt;BI/CC&lt;/th&gt;
                            &lt;th colspan="1" rowspan="1" style="width: 220px;" tabindex="0"&gt;Name&lt;/th&gt;
                            &lt;th colspan="1" rowspan="1" style="width: 288px;" tabindex="0"&gt;Supplier Number&lt;/th&gt;
                            &lt;th colspan="1" rowspan="1" style="width: 40px;" tabindex="0"&gt;Actions&lt;/th&gt;
                        &lt;/tr&gt;
                    &lt;/thead&gt;
                    &lt;tbody&gt;
                    &lt;?php
                    $query = "SELECT bicc, name, supplier_number ";
                    $query .= "FROM ext_work_risk ";
                    $result = sqlsrv_query($dbhandle, $query);
                    $i=0;
                    while($fetch = sqlsrv_fetch_array($result))
                    {
                        if($i%2==0) $class = 'even'; else $class = 'odd';                           
                        echo'&lt;tr class="'.$class.'"&gt;
                            &lt;td&gt;'.$fetch['bicc'].'&lt;/td&gt;
                            &lt;td&gt;'.$fetch['name'].'&lt;/td&gt;
                            &lt;td&gt;'.$fetch['supplier_number'].'&lt;/td&gt;                                &lt;td&gt;&lt;a class="modalButton" data-bicc="'.$fetch['bicc'].'"&gt;&lt;button type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#modal_edit" data-container="body"&gt;Edit&lt;/button&gt;&lt;/a&gt;&lt;/td&gt;
                            &lt;/tr&gt;';                         
                        }
                        ?&gt;
                        &lt;/tbody&gt;
                    &lt;/table&gt;
        &lt;/div&gt;
&lt;/div&gt;
&lt;div id="modal_edit" class="modal fade" style="font-weight: normal;"&gt;
    &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;

          &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;?php require 'style/footer.php' ?&gt;

&lt;!-- Script Part --&gt;
&lt;script type="text/javascript"&gt;
    $('.modalButton').click(function(){
        var bicc = $(this).attr('data-bicc');
        $.ajax({url:"modal/ajax_ext_risk_modal_edit.php?bicc="+bicc,cache:false,success:function(result){
            $(".modal-content").html(result);
        }});
    });
&lt;/script&gt;
</code></pre>

<p>Now the <strong>"modal/ajax_ext_risk_modal_edit.php"</strong> file:</p>

<pre><code>&lt;?php
$bicc = $_GET['bicc'];
//DB connect settins
require '../core/db_connect.php';
$query = "SELECT * ";
$query .= "FROM ext_work_risk WHERE bicc='$bicc'";
$result = sqlsrv_query($dbhandle, $query);
$fetch = sqlsrv_fetch_array($result);
?&gt;
  &lt;!-- Modal --&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;Edit Co-Worker&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
        &lt;p&gt;To edit just type the new date in the format &lt;b&gt;YYYY/MM/DD&lt;/b&gt; and click save.
          &lt;form class="form-horizontal" role="form" method="POST" action="../core/process_ext_risk_modal.php"&gt;
              &lt;div class="form-group"&gt;
                &lt;label class="control-label col-sm-4"&gt;BI/CC:&lt;/label&gt;
                &lt;div class="col-sm-7"&gt;
                  &lt;input class="form-control" id="bicc" name="bicc" readonly="readonly" value="&lt;?php echo $fetch['bicc']; ?&gt;"&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                &lt;label class="control-label col-sm-4"&gt;Name:&lt;/label&gt;
                &lt;div class="col-sm-7"&gt;
                  &lt;input class="form-control" id="name" readonly="readonly" value="&lt;?php echo $fetch['name']; ?&gt;"&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                &lt;label class="control-label col-sm-4"&gt;Sup. Number:&lt;/label&gt;
                &lt;div class="col-sm-7"&gt;
                  &lt;input class="form-control" id="supplier_number" readonly="readonly" value="&lt;?php echo $fetch['supplier_number']; ?&gt;"&gt;
                &lt;/div&gt;
              &lt;/div&gt; 
          &lt;div class="form-group"&gt;
            &lt;label class="control-label col-sm-4"&gt;LOTO:&lt;/label&gt;
            &lt;div class="col-sm-7"&gt;
              &lt;input class="form-control" id="loto" name="loto" &lt;?php $loto = $fetch['loto']-&gt;format('Y/m/d'); if ($loto == "2000/01/01") {echo "placeholder='Please insert date'";} else {echo "value='$loto'";} ?&gt;&gt;
            &lt;/div&gt;
          &lt;/div&gt;
              &lt;div class="form-group"&gt;
                &lt;label class="control-label col-sm-4"&gt;Lift Platform:&lt;/label&gt;
                &lt;div class="col-sm-7"&gt;
                  &lt;input class="form-control" id="lift_platform" &lt;?php $lift_platform = $fetch['lift_platform']-&gt;format('Y/m/d'); if ($lift_platform == "2000/01/01") {echo "placeholder='Please insert date'";} else {echo "value='$lift_platform'";} ?&gt;&gt;
                &lt;/div&gt;
              &lt;/div&gt;
          &lt;/form&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;button type="button" class="btn btn-default btn-success" type="submit" name="submit" value="Submit"&gt;Save&lt;/button&gt;
        &lt;/div&gt;
</code></pre>

<p>When I hit Save button nothing happens. Here is the <strong>../core/process_ext_risk_modal.php</strong> file:</p>

<pre><code>&lt;?php
include("db_connect.php");
if(isset($_POST["save"])) {
  $id = $_POST['bicc'];
  $data = $_POST['loto'];
  if(sqlsrv_query($dbhandle, "update ext_work_risk set loto='$data' where bicc='$id'"))
  echo 'success';
}
?&gt;
</code></pre>

<p>This last file is just for testing of course I will be Updating much more data on the form submit.</p>

<p>Thank you</p>