I am trying to disable lightning:button based on picklist field values, and the button needs to blurred out or Disabled for 4 picklist values, and i am writing lightning:button tag as mentioned below:

<lightning:button label="LABEL" onclick="{!c.dosomething}" disabled="{!or(item.fieldapi == 'value 1', item.fieldapi == 'value 2', item.fieldapi == 'value 3'. item.fieldapi == 'value 4')}"/>

Above works only for value 1 and value 2, but not for value 3 and value 4 if i change the order then again first 2 will work and gets disabled.

It will be a Great help for any solution

1 Answer 1


The or() function only accepts two arguments.

This function supports only two arguments. Any arguments after the first two are ignored.

You'll want to use the || operator instead:

If you have more than two arguments, you can chain multiple || operations.

  • Its working for || operator.Thank you
    – TKD
    Oct 13, 2020 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.