function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ramana123Ramana123 

In my visualforce page if checkbox field is disabled then I have to get the error message using custom label

My code


<apex:page StandardController="Account" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputField value="{! account.name }"/>

<apex:inputField value="{! account.label__c}"/>
<apex:inputField value="{! account.Rating}"/>
  <apex:inputField value="{! account.check_box__c}" />
   
 <apex:outputText value="{!$Label.Error_when_checkbox_is_disabled}" rendered="{!if(account.check_box__c = 'TRUE',true,false)}" />

</apex:pageBlockSection>
</apex:pageBlock>

<apex:commandButton value="save" action="{!save}"/>
</apex:form>

</apex:page>


 
SwethaSwetha (Salesforce Developers) 
HI Srikanth,
What is the error message you are seeing?Thanks
Ramana123Ramana123
Thanks for your reply swetha, I am not getting any errors but the custom label is not firing
SwethaSwetha (Salesforce Developers) 
You might want to try something like below
<apex:inputField value="{!account.check_box__c}"/>
  <apex:variable  value="{!account.check_box__c}" var="myVar"/>
   <apex:outputtext value="{!$Label.Error_when_checkbox_is_disabled}" rendered="{!myVar!=true}"/>

If this helps, please mark the answer as best.Thank you​​