I am trying like this. My goal is cancel confirmation and alert information.
var item = $('[data-toggle=confirmation]');
item.on('confirmed.bs.confirmation', function(e,v) {
if(everyThingIsOkey){
go event ...
}
else{
e.stopImmediatePropagation(); //not working
e.preventDefault(); //not working
//cancel confirmation and alert information.
}
});
item.confirmation({ btnOkLabel: 'Yes', btnCancelLabel: 'No', title: 'Are you sure?' });
I am using Bootstrap Confirmation 2.4.0 and Bootstrap v3.3.6
Here is bootstrap-confirmation examples.
My html for the problem :
<a id="cphBody_grdPopulasyon_lnkOnayla_0" class="btn btn-success btn-xs" data-toggle="confirmation" href="javascript:__doPostBack('ctl00$cphBody$grdPopulasyon$ctl02$lnkOnayla','')" style="cursor: pointer" data-original-title="" title="" aria-describedby="confirmation108897"><i class="fa fa-check"></i></a>
To make confirmation work properly you should follow two rules:
$.on()
)