In my form, I have an unshowy modal. I open the modal if the user clicks on my "leave image" and I ask if he wants to leave.
Is that possible in JavaScript (Jquery ?) to "stop" the reloading or the page change to show my modal and continue the action (Reload, Next page, Prev page, etc...) if the user says yes?
I tried:
$(window).bind('beforeunload', function(){
return 'message to show';
});
But I don't want to open the browser popup, I want mine ^^.