title: How to get data multi checkbox jquery show modal bootstrap
body: <p>I want show data multi select checkbox and show data from database on modal bootstrap ?</p>
  
  <p><strong>index(PHP)</strong></p>
  
  <p><strong>Javascript Code</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function()
  {
      $("#btnDetail").click(function()
      {
          $('#modalForm').modal('show').on('shown.bs.modal',function()
          {
              var data = $("#data").val();
              $.post('page/user/detail_user.php',
              {
                  id_data:$(this).attr(data)
              },
              function()
              {
                  $('.modal-body').html(data);
              });
          });     
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Data User</strong></p>
  
  <pre><code>&lt;table width="100%" border="1"&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td width="3%" align="center"&gt;&amp;nbsp;&lt;/td&gt;
            &lt;td width="97%" align="center"&gt;NAME&lt;/td&gt;
          &lt;/tr&gt;
          &lt;?php
          $qry = mysql_query("SELECT * FROM t_users");
          while($data = mysql_fetch_array($qry))
          {
          ?&gt;
              &lt;tr&gt;
                &lt;td align="center"&gt;&lt;input type="checkbox" name="data[]" id="data[]" value='&lt;?php echo $data['id']?&gt;'&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php echo $data['name']?&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;?php
          }
          ?&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;button id='btnDetail' name='btnDetail'&gt;Detail User&lt;/button&gt;
  </code></pre>
  
  <p><strong>Modal</strong></p>
  
  <pre><code>&lt;div class="modal fade" id="modalForm" name='modalForm' 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"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt;
                  &lt;h4 class="modal-title blue" id="myModalLabel"&gt;&lt;/h4&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Detail User(PHP)</strong></p>
  
  <pre><code>&lt;?php
   $id = $_POST['id_data'];
  
  $qry = mysql_query("SELECT * FROM t_users WHERE id='$id'");
  while($data = mysql_fetch_array($qry))
  {
  ?&gt;
  &lt;table width="100%" border="1"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
          &lt;th colspan='3'&gt;
              Detail Data Users
          &lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;ID&lt;/td&gt;
        &lt;td&gt;NAME&lt;/td&gt;
        &lt;td&gt;STATUS&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;?php echo $data['id']?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $data['name']?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $data['status']?&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  
  &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>Scenario : <br /> When button Detail User is click run Jquery and value checkbox and then send to modal bootstrap, then post from jquery run code php to show result data from database on modal bootstrap.</p>