I\'m building a fail safe for my form that is going to warn users that if they leave the page their form data will be lost (similar to what gmail does).
window.
If you include a bookmark symbol in the href of the a tag you should be able to still use the onclick event to include your JavaScript.
click
I’ve run a number of tests and this appears to execute the JavaScript without triggering the onbeforeunload event. I’d be curious to know if this works for others or if you still have the same problem after implementing a tags in this manner.