I'd like to disable a Lightning button under certain conditions.
<aura:attribute name="showSecurityComponent" type="Boolean" />
<aura:attribute name="checkCaptcha" type="Boolean" default="true"/>
<aura:attribute name="removeUserDisableButtons" type="Boolean" />
The intent is to disable the button if 1) both showSecurityComponent
and checkCaptcha
are true, 2) or if removeUserDisableButtons
is true.
I'm passing all three value params inside the disabled
property of the button:
<lightning:button aura:id="saveButtonEdit"
variant="brand"
label="Save and continue"
onclick="{! c.saveEditClick}"
disabled="{!and(v.checkCaptcha,v.showSecurityComponent,v.removeUserDisableButtons)}" />
But this isn't disabling the buttons. I'm not sure what's wrong with the syntax.