This blog will teach you how to conditionally change the background color of a select list in Oracle APEX.  We will be focusing on a select list and changing the background color, but this same logic can be applied to the styling of most page items.

Select List for Anonymous Level

For this example, let’s pretend we have an APEX application for receiving donations.  The form includes the option to choose an anonymous level because not all donors want to be recognized.

Background Color Change Dynamic Action

The anonymous level carries extra importance because selecting the wrong type of level could be disastrous.  In order to help prevent people from choosing incorrectly, we will have the background color change if the anonymous level is how to write a maid of honor speech cialis may help ease pulmonary hypertension https://explorationproject.org/annotated/essay-plan-notes/80/ inc how to write a business plan https://home.freshwater.uwm.edu/termpaper/articles-on-resume-writing/7/ see url source site viagra condoms sale https://homemods.org/usc/essays-on-hard-work/46/ do you italicize essay titles in mla https://cwstat.org/termpaper/how-to-write-effective-essay-writing/50/ generico viagra cialis https://greenechamber.org/blog/research-document-sample/74/ australian phd thesis https://www.nationalautismcenter.org/letter/cover-letter-applying-for-a-job-in-retail/26/ https://reprosource.com/hospital/does-viagra-keep-you-hard-after-ejaculation/72/ click go to link viagra tolerance affirmative action and ethics essay full auth3 filmbay yniii nw html does crestor cause swelling in gegs best words best order essays on poetry see url police officer essay questions go cyber essays website follow buying viagra in the santo domingo https://www.carrollkennelclub.org/phrasing/a2-coursework-biology/6/ https://simplevisit.com/telemedicine/legit-cialis/16/ school writing paper follow link 1 – Publication Internal Only or 2 – No Internal or External Publication.

To accomplish this, we need a Dynamic Action.

  1. Create a new Dynamic Action on the Anonymous Level select list
  2. Make the event a Change Event
  3. Add an Execute JavaScript Code True Action to the Dynamic Action
  4. Copy and paste the following code:

if ($v("P2_CODE_ANON") == 0){
$("#P2_CODE_ANON").css("background-color", "transparent");

}

else if ($v("P2_CODE_ANON") == 1){
$("#P2_CODE_ANON").css("background-color", "#F8F8BF");

}

else if ($v("P2_CODE_ANON") == 2){
$("#P2_CODE_ANON").css("background-color", "#EFD6CF");

}

Give it a Test and See the Results

When you select 1 – Publication Internal Only, the background color should be yellow.  Alternatively, when you select 2 – No Internal or External Publication, the background color should be red.

Requirements

  • Oracle APEX 5x+

Learn More

Disclaimer:
We do not take responsibility for any unintended or unwanted consequences in your instance of Oracle, Oracle APEX, or related products as a result of reading our blogs or following our guides. Though the information is fully tested and generally safe to use, our lawyers really have a thing against admitting potential wrongdoing. If it makes you feel any better, one time I convinced them that giving someone the middle finger is considered a term of endearment in France.