Ever wondered if your application could know when the client click BACK button in the browser so that the application to act accordingly? Well, it happen to be possible. After some googling and more tests and fails, here is what i came to.

<script language="JavaScript" type="text/JavaScript">
<!--
   window.onunload = backAlert();
   
   function backAlert()
   {
      window.onbeforeunload = function ()
      {
         if (true)
         {
            return "Warning! If you go back, your data will not be saved.";
         }
      }
      return false;
   }
//-->
</script>

What it will do is to fire a confirmation alert when the back button will be hit. Actually it will fire that alert on some other events too, so for particular conditions you may want to alter the code.
For example, if you have a form, the alert will appear on submit too. So, for this particular situation i would do the following:

<form action="yourscript.cfm" method="post" name="frm" onsubmit="document.frm.tstfld.value=1;">
   <input name="tstfld" type="Hidden" value="0">
   <input type="Text" name="t1" value=""><br>
   <input type="Text" name="t2" value=""><br>
   <input type="Text" name="t3" value=""><br>
   <input type="Submit" value="Submit">
</form>

<script language="JavaScript" type="text/JavaScript">
<!--
   window.onunload = backAlert();
   
   function backAlert()
   {
      window.onbeforeunload = function ()
      {
         if (document.frm.tstfld.value != 1)
         {
            if (true)
            {
               return "Warning! If you go back, your data will not be saved.";
            }
         }
      }
      return false;
   }
-->
</script>

So.... I have there a special hidden field with the value of zero that is changed to 1 when the form is submitted. And on the JS side make sure the alert will not happen when form submition happens.
There should be an easier way to know when the form is submitted, but i could find it now.

If anyone have better solutions, please share.