You need to sign in to do that
Don't have an account?

Able to perform Action even after Onclick button is disabled.
I am using styleClass to disable the button. In UI it is showing as disabled. But when I click on the button, I am able to perform an action. Please suggest me a solution.
<apex:commandButton id="canceldone" value="Cancel" onclick="OpenModel();return false;" styleClass="searchClass ordervalue btn btn-primary disabled {!IF( Industry == 'Enterprise','','sectionHeader')}" rerender="" ></apex:commandButton>
<apex:commandButton id="canceldone" value="Cancel" onclick="OpenModel();return false;" styleClass="searchClass ordervalue btn btn-primary disabled {!IF( Industry == 'Enterprise','','sectionHeader')}" rerender="" ></apex:commandButton>
instead of adding the style class we have disabled property in CommandButton tag try that one.
Thanks,
Maharajan.C
All Answers
instead of adding the style class we have disabled property in CommandButton tag try that one.
Thanks,
Maharajan.C
If-else doesn't directly work like that, you should make use of the ternary operator and return a boolean value like
if you find this helpful mark it as the best answer.
thanks
Malika Pathak