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.

Code not working

Avatar

Level 4

Hi All,

I have written the following code, but it is not working, and I do not know why. I wrote this using javascript.

  

if(BTY.rawValue > 1 & Kasc.rawValue > 3){
    Grllac.presence="visible";
}

I am just wondering if it is not responding to the &(AND) operator I used.

Thanks

v/r

Tammy

5 Replies

Avatar

Level 8

You're using a bitwise AND (&) when you want to be using a logical AND (&&).

Kyle

Avatar

Level 4

Thanks Kyle, I did change that, and it does not seem to get into the second part of the script after the AND &&. Here is the code.

if(BTY.rawValue > 1 && Kasc.rawValue > 3){
    Grllac.presence="visible";
}

Avatar

Level 7

The code is correct - but where did you put it?

Avatar

Level 4

Good morning. I have the code placed on the exit event of the two checkboxes named BTY and Kasc. I also tried it on the click events of these checkboxes, and it still does not work.

Thanks

v/r

Tammy

Avatar

Level 8

Hmmm, well a check box only has two states on and off. Both of which can be assigned values. In your case though you have a greater than operator (>) which confuses me since I'd expect an equals to (==). Not that you can't use greater than, there's just really no point.

You might want to post your pdf so we can have a look and better unerstand what you're trying to do.

Kyle