Table 1. logical operators and the functions they perform
An example of a conditional expression that uses logical AND is shown in the action. Suppose that the action is in the bgcolor option of FIELD1. In this case, the background color option of FIELD1 is set to gray when FIELD1 has the focus and
FIELD2 is empty, otherwise FIELD1 is set to blue.
FIELD1.focused == 'on' && FIELD2.value == '' ? 'gray' : 'blue'
The previous action reads as follows: Is the focused option of the field equal to 'on' and is the value of FIELD2 empty? If true, set the value of the bgcolor option to 'gray'. If not true, set the value of the bgcolor option to 'blue'. In other words, if FIELD1 has the focus and FIELD2 is blank, then the background color is gray, else the background color is blue.
Parent topic: Action operator overview