Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Though I was making a simple IF condition

Avatar

Level 2

Hello,

I've been trying to troubleshoot this for several days now and I seem to still be missing something.

I have a drop down menu with two options. In the properties for the drop down, I specified in the Binding tab to "Specify Item Values" (1 and 2).

Under the Change Event I place the below code.

if (this.rawValue="1"){

annOverview.necDate.presence="hidden";

}

else if

(this.rawValue="2"){

annOverview.necDate.presence="visible";

}

Though, no matter which selection I make, the necDate goes hidden. I've tried all other Events without success.

Should I be using something other than the IF statement?

Thank you,

Erik

1 Accepted Solution

Avatar

Correct answer by
Level 2

So I happen to come across the below posting and found that if I used the Case function instead of the IF statement the code works as expected under the Exit event.

Re: Display image based on drop down selection.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 2

So I happen to come across the below posting and found that if I used the Case function instead of the IF statement the code works as expected under the Exit event.

Re: Display image based on drop down selection.