title: Codeigniter Bootstrap Modal Delete
body: <p>So I wanted to delete a row in a table using a delete button, which will then show a modal to confirm the delete process. However, I need to pass the ID, in this case I used filename, to the URL in order to complete the delete process. However, I can't seem to pass the complete URL in order to delete in the "YES" button in the modal. I am trying to simulate a process like this: <a href="http://plnkr.co/edit/NePR0BQf3VmKtuMmhVR7?p=preview" rel="nofollow noreferrer">Plunker</a></p>
  
  <p>Here's the code.</p>
  
  <p>Modal:</p>
  
  <pre><code>&lt;div class="modal-body text-center"&gt;
        &lt;p&gt; Are you sure you want to remove this from the list? &lt;/p&gt;&lt;br&gt;&lt;br&gt;
        &lt;button type="submit" class="btn btn-custom-1"&gt;Yes&lt;/button&gt;
        &lt;button type="button" class="btn btn-custom" data-dismiss="modal"&gt;Cancel&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Delete Button:</p>
  
  <pre><code>&lt;button type="button" class="btn btn-custom-3" data-href="&lt;?php echo base_url() . 'admin_forms/delete_carsticker/' . $row-&gt;filename; ?&gt;" data-toggle="modal" data-target="#delete-modal"&gt;&lt;span class="glyphicon glyphicon-trash" aria-hidden="true"&gt;&lt;/span&gt;  Delete &lt;/button&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>  $('#delete-modal').on('show.bs.modal', function(e) {
      $(this).find('.btn-custom-1').attr('href', $(e.relatedTarget).data('href'));
  });
  </code></pre>