Posts

Showing posts with the label Confirm

Confirm Deletion Using Bootstrap 3 Modal Box

Answer : You need the modal in your HTML. When the delete button is clicked it popup the modal. It's also important to prevent the click of that button from submitting the form. When the confirmation is clicked the form will submit. $('button[name="remove_levels"]').on('click', function(e) { var $form = $(this).closest('form'); e.preventDefault(); $('#confirm').modal({ backdrop: 'static', keyboard: false }) .on('click', '#delete', function(e) { $form.trigger('submit'); }); $("#cancel").on('click',function(e){ e.preventDefault(); $('#confirm').modal.model('hide'); }); }); <link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"...