IfnotFr / PopConfirm

A simple action confirmation plugin for jQuery based on Twitter Bootstrap Popover

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to combine confirm and ajax

laurencei opened this issue · comments

Hi,

How do I combine the confirm with an ajax request if they accept?

i.e. I have this code

$(".confirm-action").popConfirm();

and I have this code

$('.confirm-action').click(function(e){
            e.preventDefault();
            $.ajax({
                      // Ajax stuff here
            });
});

How do I make it that the ajax only fires if they click accept?

Hi and thanks for using PopConfirm.

What is the actual behaviour of PopConfirm in your case ?

This is an example i wrote using using jquery $.get (similar to $.ajax).

http://jsfiddle.net/FbS5F/

Please do not use e.preventDefault(); where it break the action chain required by PopConfirm triggers.

I close this issue as you did not respond in two weeks :)

I hope that my snippet helps you.