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!

javascript cancel ..stay on the current page..

894843Jan 8 2012 — edited Jan 10 2012
Hi all..

Please help with this issue.
I have a page where there are 2 buttons, I dont want the users
navigate away from the page by clicking any of the breadcrumbs or tabs links.
I want to show a confirm message.

I created a dynamic action with a ""unload"" event with the following code
var req = $v('p_request');
if (req == 'CANCEL' || req == 'GET_NEXT_DOC_ID')
  {
   alert('ok');
  }
else
  {

   var r=confirm("Are you sure you want to navigate away from this page?");
    if (r==true)
    {
    // They need to go the page that they clicked
    }
   else
    {
    // They need to stay on the current page.
     }

  }
Please let me know, how can i do this.

Thanks
This post has been answered by Tyson Jouglet on Jan 9 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 7 2012
Added on Jan 8 2012
13 comments
1,969 views