Just change the line of code:
event.returnValue = confirmMsg;
as the following;
event.preventDefault = confirmMsg;
Hope this will work!
Thank you Nith, but I tried it with no luck, and it stopped working in IE. Anything else I can try?
The code I mentioned is applicable only to FireFox.
To make your logic work on both browsers, you need to find out the browser type and should handle the event accordingly.
You can detect the browser type by:
alert("Browser name: "+ browser);
alert("Version: "+ version);
I did check in both IE and FF but the browser juct closed silently. Did I miss anything in the code?
I will try to make an example and then let you know.