jQuery Delete Confirmation |
[eluser]lefoup[/eluser]
[quote author="Kemik" date="1201831399"]Thanks guys. To pass a variable could I just do: Code: <a href="#" onclick="return deletechecked('Are you sure you want to delete <?=$row->username ?>');">Delete checked messages</a> Code: function deletechecked(message) I'll add my appreciation too. Very helpful, thanks a lot!
[eluser]skunkbad[/eluser]
I can't really take the time to explain how this works, but my javascript uses ajax to connect to another method in my controller, and that method calls a delete method in a model. If the delete method was successful, then it passes a confirmation back to the controller, which sends it back as the ajax response. I can then mark the row as deleted: Code: $('.delete-img').live('click', function(){ The nice thing with this code is that I can adapt it to any type of user, photo, file, or anything else that I want may want to delete.
[eluser]CodeIgniteMe[/eluser]
You can use the jQuery UI Library. (http://jqueryui.com) It has a dialog box that is totally customizable. You can have your own title and message (html/css formatted) and your own custom buttons and button texts. Cool!
[eluser]Amitabh Roy[/eluser]
[quote author="OOP-MVC addict" date="1309525670"]You can use the jQuery UI Library. (http://jqueryui.com) It has a dialog box that is totally customizable. You can have your own title and message (html/css formatted) and your own custom buttons and button texts. Cool![/quote] +1 for jquery UI |
Welcome Guest, Not a member yet? Register Sign In |