Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

modal popup & onbeforeunload...

Hippy SteveApr 27 2014 — edited Apr 28 2014

I'm using the SkillBuilders modal popup plugin, excellent piece of kit.  Now I want to stop users from closing the modal page without clicking the close button.

I've put in the bog-standard jscript function to the onbeforeunload which works perfectly when I show the page in stand-alone mode.  But when I show it as a modal popup then the window closes before the confirm message appears...  I've tried numerous variations, even the script below which fires however you move away from the page, when the page is a popup then it disappears before the confirm dialogue displays, simply returning to the parent page.

Anybody else seen this?  How did you get round it?  Is it something I've missed on the setup of the modal page?

   <script type="text/javascript">

         window.onbeforeunload = function(){ return 'are you sure you wanted to do that?';}

    </script>

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 26 2014
Added on Apr 27 2014
6 comments
989 views