Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a href="delete?id=1" class="confirm">Delete 1</a>
- <a href="delete?id=2" class="confirm">Delete 2</a>
- <a href="delete?id=3" class="confirm">Delete 3</a>
- <div class="modal hide fade" id="confirm-delete" role="dialog" aria-labelledby="confirm-delete-header" aria-hidden="true">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h3 id="confirm-delete-header">Delete Confirmation</h3>
- </div>
- <div class="modal-body">
- <p>Are you sure you want to delete this record?</p>
- </div>
- <div class="modal-footer">
- <a href="#" class="btn" data-dismiss="modal" aria-hidden="true">Cancel</a>
- <a href="#" class="btn btn-danger">Delete</a>
- </div>
- </div>
- <script>
- $(document).ready(function() {
- // Confirmation modal
- $('a.confirm').click(function(e) {
- e.preventDefault();
- $('#confirm-delete').data('href', $(this).attr('href')).modal('show');
- });
- $('#confirm-delete').on('show', function() {
- $(this).find('.btn-danger').attr('href', $(this).data('href'));
- });
- });
- </script>
Add Comment
Please, Sign In to add comment