title: How to get value of data-id and place it into a twitter bootstrap modal?
body: <p>Im trying to get the value of the data-id which contains and id in my database. I need to get the admin_id and place it into a twitter bootstrap modal. How am I going to get that value using java script?</p>
  
  <pre><code>&lt;a data-toggle="modal" data-id="&lt;?=$row['ADMIN_ID'];?&gt;" href="#view_contact" class="btn btn-info btn-xs view-admin"&gt;View&lt;/a&gt;
  </code></pre>
  
  <p>here is my modal</p>
  
  <pre><code>            &lt;div class="modal fade" id="view_contact" role="dialog"&gt;
                  &lt;div class="modal-dialog"&gt;
                      &lt;div class="modal-content"&gt;
  
                          &lt;div class="modal-header"&gt;
                              &lt;h4&gt;Admin modal!!&lt;/h4&gt;
  
                          &lt;/div&gt;
  
                          &lt;div class="modal-body"&gt;
                              Admin Id:&lt;p id="showid"&gt;&lt;/p&gt;
                          &lt;/div&gt;
  
                          &lt;div class="modal-footer"&gt;
  
                              &lt;a class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/a&gt;
  
                          &lt;/div&gt;
  
  
                      &lt;/div&gt;
  
                  &lt;/div&gt;
  
              &lt;/div&gt;
  </code></pre>
  
  <p>here is my java script</p>
  
  <pre><code>            &lt;script type="text/javascript"&gt;
  
  
              $(document).on("click", ".view-admin", function () {
                   var adminid = $(this).data('id');
                   $(".modal-body #showid").val( adminid );
                   $('#view_contact').modal('show');
              });
  
              &lt;/script&gt;
  </code></pre>
  
  <p>its not showing in my modal. They are all in the same page. How do I do this? Kinda new at this.</p>