Press "Enter" to skip to content

Oracle Apex: Dynamic Action Execute JavaScript Code Example

In this tutorial, you will learn how to create dynamic action in Oracle Apex to execute JavaScript code.

In the following example, I have two text fields on my page, one is a Value A and another is a Value B. I have created a dynamic action on Value B field to validate that Value B should be greater than or equals to Value A. To do this task, follow these steps:

Creating Dynamic Action to Execute JavaScript Code

Do the right-click on the Value B field and select Create Dynamic Action from the menu.

Select Event as Lost Focus and Action as Execute JavaScript Code.

Then add the following JavaScript code in the Code field:

if ($v('P39_VAL_B') < $v('P39_VAL_A')) {
    apex.message.alert('Value B should be greater than or equal to Value A.');
}

The following is the screenshot for the above settings:

Oracle Apex: Create dynamic action to execute JS code.

Now save the changes and run the page to test. The output would be as following:

Execute JavaScript code dynamic action.

Related Tutorials:

Have you found the answer to your question? If not, you can discuss it with me in the comments section below or join my Q&A community OrclQA.com for developers and ask your question. It is FREE.

Vinish Kapoor

Follow

Hi, I am a full stack developer and writing about development. I document everything I learn and help thousands of people. foxinfotech.in is created, written, and maintained by me; it is built on WordPress, and hosted by Bluehost. Connect with me on Facebook, Twitter, GitHub, and get notifications for new posts.

guest
0 Comments
Inline Feedbacks
View all comments