I am trying to create a function that will create an confirm delete message on any link or button with the class of "delete", inside a bootstrap modal. I currently have this code to create a regular confirm dialog:
'init_confirm_delete' : function(){
$('a.delete,button.delete').live('click',function(e){
return confirm('Are you sure you want to delete this?');
e.preventDefault();
});
},
That works fine. Below is my new code trying to integrate bootstrap UI:
'init_confirm_delete' : function(){
$('a.delete,button.delete').click(function () {
$('#delete-confirm').dialog('open');
return false;
});
$("delete-confirm").dialog({
autoOpen: false,
modal: true,
buttons: {
Ok: function () {
$(this).dialog("Delete");
},
}
})
},
Any ideas fellow coders?