I am looking to create a JavaScript function that will display a confirmation popup box when a user clicks on the ‘Cancel’ button in an APEX 3.2 application.
I want to ask ‘Are you sure you want to cancel this issue?’. Show a ‘Yes’ and ‘No’ button. If the user clicks ‘Yes’, send them to page 1. If the user clicks ‘No’, keep them on this page (2).
I just need to know how to send the user to page 1 or keep them on page 2. Many thanks!!!
function confirmCancel()
{
var r=confirm("Are you sure you want to cancel this issue"?);
if (r==true)
{
Go to page 1
}
else
{
Stay on page 2
}
}
There are maybe some functions in the APEX 3.2 JavaScript API that could be useful for you (
confirmDelete()for example).Else you can use apex.submit, passing an item with a specific value, then depending on that item value you can have a page branch.