user3797879 user3797879 - 1 year ago 108
jQuery Question

Java script how to make a confirm dialog?

I am writting app using Django. I don't want to make a new template, but I want to make sure if user really want to delete this element.

I just use href to go to view, delete element and I then go back do the current one. Is there any simple way to do this dialog or should I do everything with Django?

I am using this code to redirect to delete element.

<td><a class="button icon remove" href="delete/{{ }}" role="button" value={{ }}>Delete</a>

Answer Source

You can use Bootbox.js. It gives you nice bootstrap message boxes, i.e alert, confirm and prompt.

Sample code:

bootbox.confirm("Are you sure?", function(result) {"Confirm result: "+result);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download