I'm trying to do a dialog before deletion so I've added e.preventDefault() from deletion happening straight away but when I'm in the YES function I want to simulate the function to continue it's click event with return true and e.preventDefault() to be false. How do I continue the click event to do it's operation?
<script type="text/javascript">
$(function() {
$('#delete_registry').on('click', function(e) {
e.preventDefault();
alertify.confirm('Delete Registry', 'Are you sure you want to delete your registry, all data will be lost', function() {
console.log('deleting information');
this.close();
return true;
}, function() {
this.close();
return false;
})
.setHeader(header)
.setting({
'closable': false,
'resizable': true,
'labels': {'ok': 'Yes', 'cancel': 'No'}
});
});
});
</script>
Try this simple