Jump to content

Open Window Popup When Close Accidently A Page


Recommended Posts

Hi, 

in a report page, i have my table that contain some documents. When i select a document, i have some fields change values in back ground (thanks to window.open with an autosubmit) and then the user is invited to click on a button (in the table of documents) to set a checkbox to true that mean "this document is controled". as this far evry thing is okay

 

My problem is , if in somehow the page is closed or refreshed before the user click the button, the document will be lost from this table (because the fields used in search have changed) and also in other tables that show only the controled documents.

I tried to use the function onbeforeunload to block the close event with a warning popup, but the window.open (to change back the fields that i have changed them automaticly) is not executed

window.onbeforeunload = function () {
  if ([@field:myFieled] == "true")
   {
    window.open("URL", " ");
    return 'if you close the window your document will be lost';
   }
};

If any one could help me how to make that window.open be executed or any other idea would be appreciated.

Olfa

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...