Skip to content
Advertisement

How to use confirm box in php codeigniter inside a function of a controller?

JavaScript

I have written something like this. Now I want to delete something but I want user to confirm it before deletion. This function is inside controller.

Advertisement

Answer

You can simply provide the JavaScript code when generating the button, link, or whatever needs confirmation. Example:

JavaScript

That way the link / button would be activated only if the user presses ‘OK’ in the confirmation dialog.

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