Disable "Are you sure you want to Leave this page?" window popup on close of crm form.


  • Hi, I am looking for a javscript code to disbale the windows close poup "Are you sure you want to Leave this page?" when I close the crm form using save & close or just close the form.


    Wednesday, January 25, 2012 4:21 PM

All replies

  • Hello Singh Saab

       The reason why this message of "Are you sure you want to Leave this page?"  is the page is dirty

        Its not Crm functionality which is displaying this instead you web page feature,

     you can supress it using javascript

    To turn it on: window.onbeforeunload = "Are you sure you want to leave?";
     To turn it off: window.onbeforeunload = null;



    If the problem is resolved, we would appreciate a post explaining the resolution and mark the post answered and close the thread.

    Wednesday, January 25, 2012 4:41 PM
  • Hi,

    I used "crmForm.detachCloseAlert();", it worked.

    window.onbeforeunload = null; did not work


    Thanks for the idea..


    Wednesday, January 25, 2012 5:18 PM
  • Hello, I have the same problem after my PC updated and restarted.

    But I don't understand what you guys are  talking about here

    Can u break it up please. Where to go and what to do


    Friday, July 12, 2013 2:26 AM