3

I have a wizard form (single html page with multiple form sections) that I am validating using multiple Ajax calls (POST requests to and from an iFrame for IE9 support) and I am having some very strange behavior with an onbeforeunload() event. On 2/3 sections of the form I want this event to occur, it does, but one particular form segment has strange behavior when I click the browser back button.

Here is how I administer the property:

$(window).on({
    beforeunload : function(e) {
    return "If you navigate away from the page, you'll lose any unsaved information.";}
});

When I click on the browser back button in the particular spot in the page, my ajax call fires and the success callback activates. Super crazy. I've tried setting that property everywhere I can think of. Any advice is appreciate. I can paste more relevant code if need be.

EDIT: Also, through some form of sorcery, the title of the page changes in the broswer tab to the page's URL, strange...

Bigtrizzy
  • 103
  • 2
  • 7

0 Answers0