I currently have a website that uses a cart-like system for temporarily holding enquiries. I currently use the Javascript onunload function to stop the user from leaving the page and loosing his/her enquiries in the cart.
The only problem I have is that the cart spans across multiple pages which is fine because it is session based but whenever I try to change page the onunload even pops up and can be very annoying.
Is it possible to set the onunload event to the close button on the browser so it only shows when they try and close it possibly?
I hope we can find something as re-designing the site is not really an option,
Thank you