jquery.dirtyforms
jquery.dirtyforms copied to clipboard
Ignore page refresh event
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?
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;