Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

If statement with and / or

Avatar

Level 9

I am trying to write an if statement that involves and or conditions.

if (object1.rawValue !== null  &&  object2.presence == "visible" || object3.rawVaule == "Yes"){

     Do the following...

}

The script above is not working. I want the script to fire if object1 is not blank and either object2 is visible or object3 equals Yes (or both).

1 Accepted Solution

Avatar

Correct answer by
Level 5

if ((object1.rawValue !== null  &&  object2.presence == "visible") || (object1.rawValue !== null  && object3.rawVaule == "Yes"))

{

     Do the following...

}

This sould be help..

Kind regards Mandy

View solution in original post

3 Replies

Avatar

Correct answer by
Level 5

if ((object1.rawValue !== null  &&  object2.presence == "visible") || (object1.rawValue !== null  && object3.rawVaule == "Yes"))

{

     Do the following...

}

This sould be help..

Kind regards Mandy

Avatar

Level 9

Mandy,

Thank you so much for your help with this!

-Don

Avatar

Level 5

Great. I'm happy that I could help you!!

Kind regards,
amndy