title: Issue in passing a data id to bootstrap modal
body: <p>I have a listing page containing a link button to show modal repeating in a PHP loop. I have searched and found these: 
  <a href="https://stackoverflow.com/questions/10626885/passing-data-to-a-bootstrap-modal">Passing data to a bootstrap modal</a>, <a href="https://stackoverflow.com/questions/20723111/passing-data-to-bootstrap-3-modal">Passing data to Bootstrap 3 Modal</a> and <a href="https://stackoverflow.com/questions/25565874/pass-id-to-bootstrap-modal">Pass id to Bootstrap modal</a> and some others but failed.</p>
  
  <p><strong>What I want</strong></p>
  
  <p>I have fetched the data  id from database and pass it to bootstrap modal and there I will use this id to display more info through MySQL queries.</p>
  
  <p>I have written all the code but the ID is not passing to the modal.</p>
  
  <p><strong>Modal Link Button code</strong></p>
  
  <pre><code> &lt;a class="btn btn-warning btn-minier" href="#modal-form-show" role="button" data-toggle="modal" data-target="#myModal" data-id="&lt;?php echo $cottage_id ?&gt;"&gt;&lt;i class="icon-edit bigger-120"&gt;&lt;/i&gt; Reservation &lt;/a&gt;
  </code></pre>
  
  <p><strong>Modal code</strong></p>
  
  <pre><code> &lt;!-- Modal --&gt;
      &lt;div id="myModal" class="modal fade" role="dialog"&gt;
        &lt;div class="modal-dialog"&gt;
  
          &lt;!-- Modal content--&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;Reservation Details&lt;/h4&gt;&lt;br&gt;
              &lt;h5&gt;Cottage Id :&lt;/h5&gt;
              &lt;h5&gt;Cottage Title :&lt;/h5&gt;
  
            &lt;/div&gt;
            &lt;div class="modal-body"&gt;
              &lt;p&gt;ID WILL SHOW IN THIS TEXT FIELD.
             &lt;input type="text" name="cottage" placeholder="cottage id" value="" id="cottage" /&gt; 
              &lt;/p&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;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p><strong>JS code</strong></p>
  
  <pre><code>$('#modal-form-show').on('show.bs.modal', function(e) {
    var c_id= $('a[href="#modal-form-show"]').data('id');
    //var c_id= $(this).data(id) - checked both
    $("#cottage").val(c_id);
  });
  </code></pre>
  
  <p>I have taken a text input in modal named cottage and I want show that id in this input.</p>