This method works on both IE and FF I believe (well the modern ones).
Basically this came out of a need to stop users, who being users, will click BACK and FORWARD REFRESH with gay abandon usually at the most inopportune times, even more so when it as an AJAXy form.
Here is the code.. Bung it in your [head] Section
window.beforeunload = isthatwise;[/script]
window.onunload = smug;
alert("OK you know best.. Bye-Bye Now!");
return "Now listen you!\nThis is your programmer speaking\nI worked long and hard on this code\nand i think you maybe about to do something silly\nare you sure you want to do that?"
I think it would probably be a good idea to change the text of the messages unless your users are as understanding of my foibles when it comes to error messages as mine are.
And then put this on your BODY tag
[body onBeforeUnload="return smugcomment();"]
When you get to a point on your form where unload is ok simply set the two events to null
window.beforeunload = null;
window.onunload = null;
It is also wise when AJAXing to ensure that there is no page cacheing so that they (the users) cant actually go back to a page in the middle of a transaction.