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!

Change background color of display only item based on item value

User_PGROIApr 15 2017 — edited Apr 16 2017

Hi,

I'm looking for a way to change the background color of a display item (P4_IS_REGISTERED_TXT) based on the item value of a hidden item (P4_IS_REGISTERED_VAL).

I created a dynamic action which executes when the value of the hidden item changes. The action contains the following if/else construct:

if ($v('P4_IS_REGISTERED_VAL') == 0) {

    //What should I put here to change the backgroud color of the display item?

}

else {

    //What should I put here to change the backgroud color of the display item?

}

I already tried pretty much everything I could find on the internet, but nothing worked:

$('#P4_IS_REGISTERED_TXT').style.backgroundColor = "green";

$x("P4_IS_REGISTERED_TXT").style.backgroundColor = "green";

Document.getElementById('P4_IS_REGISTERED_TXT').style.background = 'green';

Document.getElementById('P4_IS_REGISTERED_TXT').css({"background-color":"green"});

I'm working with APEX 5.1.

Thanks a lot.

This post has been answered by Pierre Yotti on Apr 15 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2017
Added on Apr 15 2017
12 comments
4,082 views