jquery.dirtyforms icon indicating copy to clipboard operation
jquery.dirtyforms copied to clipboard

Ignore page refresh event

Open daughtkom opened this issue 5 years ago • 1 comments

I've got everything working perfectly with one exception. I am using the dialog (bootstrap, using recommended plugin), enabling/disabling submit buttons, etc. Everything is great.

Except... the browser's default beforeunload dialog is displayed on page refresh. I get why it's not showing the bootstrap dialog, but my preference is to have the refresh action (F5, Ctrl+R, etc) bypass all dirty checking entirely and simply refresh.

Is that an option? I'm still digging on my own, and have been for a while, but thought I'd post here to see if there's something easy I'm just missing. Is this possible?

daughtkom avatar Dec 13 '19 01:12 daughtkom

This is what I'm doing for now, but not sure if I'm losing anything else by doing it this

$("form#myform").dirtyForms({
// ...
});

$(window).unbind('beforeunload');
window.onbeforeunload = null;

daughtkom avatar Dec 13 '19 01:12 daughtkom