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!

On form save add a confirmation dialog box with Cancel, No and Yes buttons

Pericles40 hours ago

In APEX 24.2, adding a confirmation dialog with OK and Cancel buttons is straightforward using the Require Confirmation option.

You can also achieve this with a custom JavaScript implementation — a well-documented approach. The following code displays the confirmation dialog only when the approve message item contains a value:

var msg = $v("P687_APPROVE_MESSAGE"); // get message text 
if (msg) { 
	// If there is a message, show confirmation dialog 
	apex.message.confirm(msg, function(okPressed) { 
		// Store the user’s response 
		$s("P687_ANSWER", okPressed ? "YES" : "NO"); 
		
		// Always execute SAVE after the response 
		apex.submit("SAVE");
	});
} else { 
	// If no message, just continue and mark answer as N/A 
	$s("P687_ANSWER", "NONE"); 
	apex.submit("SAVE"); 
}

I need to implement a confirmation dialog with three options:

  • Cancel: Returns to the edit form
  • No: Submits the page and sets P687_ANSWER to NO
  • Yes: Submits the page and sets P687_ANSWER to YES

Has anyone implemented something similar before?

Alternatively, I’m considering adding a select item to the form that requires the user to make a choice directly, eliminating the need for a confirmation dialog.

Thanks!

This post has been answered by Christian Pitet 2 on Oct 8 2025
Jump to Answer
Comments
Post Details
Added 40 hours ago
3 comments
47 views