I decided to change and slightly modify my code using Alertify. My old code is:
<script type="text/javascript"> $('.ask').click(function(){ var answer = confirm('<?php echo $this->translate('Delete route?'); ?>'); return answer; });
When I click ok, the php script starts and removes the entry. Javascript returns true or false.
The problem with Alertify is that I canβt even click ok or cancel, my php script works before that. Here is the code:
$(".ask").click(function(event){ alertify.confirm("Are you sure you want to commit your reservation?", function (e) { if (e) { return true; } else { return false; } });
});
I saw some people with similar problems, and I saw that I need to use the default warnings (this makes sense) Code:
$(".ask").click(function(event){ event.preventDefault();
});
In this case, the PHP script does not start before I click ok / cancel, but it does not start when I click one of the buttons. Nothing happened. Any help please?
source share