Expand my Community achievements bar.

OR syntax not working

Avatar

Former Community Member
At least one of the boxes must be checked in order to pass the edit check but I can't get it to work properly!



If I check at least one of the boxes, the message still appears as if NEITHER box is checked. So it doesn't matter whether I check a box or not the message appears!



The syntax is on a Edit Button that also check for other things which all works. This is the only one that I can't get to work properly!



if ((form1.subPage3.subApply25.ckbQuest26dol.rawValue == 0) || (form1.subPage3.subApply25.ckbQuest26call.rawValue == 0)) {

xfa.host.messageBox("At lease one is required.", "Warning", "1")

exit;

}



Please help and thanks
3 Replies

Avatar

Level 7
The syntax for the logical "OR" operator in LiveCycle Designer is "or". An example from LiveCycle Designer's "Scripting" reference that uses the "or" operator:



Expression: __ | Equivalent to: ____ | Returns:

0 and 1 or 2 > 1 | (0 and 1) or (2 >1) | 1 (true)

Avatar

Level 5
Hi Patricia,

With your description I guess you need to use "And" operatior in place of "Or" operator........



if ((form1.subPage3.subApply25.ckbQuest26dol.rawValue == 0) && (form1.subPage3.subApply25.ckbQuest26call.rawValue == 0)) {

xfa.host.messageBox("At lease one is required.", "Warning", "1")

exit;

}



Good Luck,

Sekhar

Avatar

Former Community Member
Hi Sekhar,



Your are right..I should use AND instead or OR. I don't know why I was trying to use OR instead of AND...guess one of those days **lol**



I used another way suggested by the Acrobat User Community Forums



http://www.acrobatusers.com/forums/aucbb/viewtopic.php?pid=37420#p37420



I love these forums...they are so HELPFUL and a great learning tool!



Thanks for your help!