Link to home
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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.