Skip to main content
1 online
iwz Oct 21, 2003

history.back() works for IE, I believe. but the problem here is that if the user is leaving the page by going to any other page, forward in the site, some other site altogether, or whatever, win...

deanh77 Oct 21, 2003

history.back() is the equivalent of history.go(-1) I'm doing history.go(0) which keeps you where you are. works in Mozilla, not in IE. you're only prevented if hasChanged == 1, and also, I ha...

iwz Oct 21, 2003

oh yeah.. i fooled myself with the 0/-1 thing. do you really have to prevent them from hitt Back? It would be a lot easier if you just checked hasDirty() when clicking on any submit buttons or U...

deanh77 deanh77Founder

back isn't important, I need a way of preventing them from leaving the page when they:

1) click any link in the page
2) click any button in the page (except the save changes button, which will clear the dirty flag)

How would I do this? I can't add onClick()'s to every link in the page, because some of them are from an included page that has navigation links, and is used on pages where there is no dirty flag.

Welcome Back to eZabel

It's been a while. Here's what's new.

eZabel Lore

A complete history of our community — stats, Hall of Fame, legendary threads, and more.

View the Lore →

Everything Preserved

All 225,969 pieces of content from 2000–2014 are here — forums, messages, journals, photos, polls, and events.

💎

Gems

Spot something you love — a legendary comment, a classic thread, a great photo? Log in and click the diamond icon to mark it as a Gem. Add a note about why it's special. The best stuff surfaces on the Gems page.