Skip to content
Advertisement

How to add a confirm dialog box using SweetAlert2 in CodeIgniter 3?

I’m learning CodeIgniter 3 and I want to add a confirm dialog before deleting a row in the database table. I’ve made the delete function but couldn’t figure out how to add a confirm dialog box using SweetAlert2.

code in view

JavaScript

code in controller

JavaScript

code in model

JavaScript

Advertisement

Answer

Here is a simple integration, try and let me know

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement