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 UI links.
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.