ItSolutionStuff.com

JQuery Delete Confirm Modal using Bootbox Example

By Hardik Savani • April 21, 2023
PHP Javascript Bootstrap jQuery Bootbox.js

We always need ask confirmation for remove items. I mean we always ask before deleting items. So if you need to ask confirm before do something like delete, change status, change value etc as you require. If you want to do with better layout then you have to chooes bootbox.js and if you already use bootstrap then it's very better so, let's see bellow example and use it.

Example:

<html lang="en">

<head>

<title>Delete confirm modal using bootbox example</title>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

</head>

<body>


<button class="btn btn-danger remove">Delete</button>


<!-- bootbox code -->

<script src="https://raw.githubusercontent.com/makeusabrew/bootbox/gh-pages/bootbox.js"></script>

<script>

$(document).on("click", ".remove", function(e) {

bootbox.confirm("Are you sure you want to delete?", function(result) {

if(result){

console.log('write code of remove item.');

}

});

});

</script>


</body>

</html>

I hope it can help you...

Tags: jQuery
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Add Bootstrap 5 in Angular 15?

Read Now →

Angular 14 Bootstrap 5 Datepicker Example

Read Now →

Angular 9/8 Bootstrap Collapse Example

Read Now →

Bootstrap Datepicker Disable Specific Dates Example

Read Now →

PHP Bootstrap Autocomplete Tokenfield using Ajax Example

Read Now →

Bootstrap SweetAlert Confirm Dialog Box Model Example

Read Now →

Bootstrap Fancy Alert Box using SweetAlert Example

Read Now →

JQuery Bootbox Modal Dialog Prompt Example

Read Now →

How to Use Collapse Example in Bootstrap?

Read Now →

How to Add Dialog Box in Bootstrap?

Read Now →

How to Add Tooltip in Bootstrap?

Read Now →