Link to home
Start Free TrialLog in
Avatar of Shiv Om Sharma
Shiv Om SharmaFlag for India

asked on

how to disable onbeforeunload on form submission

I want to implement onbeforeunload  on tab close but want to disable  onbeforeunload  on form submission :

$('input[type="submit"]').on("click", function (e) {
      window.onbeforeunload = function() {};
      $(window).unbind('beforeunload');
});
does not work.
it still shows leave confirmation message
ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial