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
Anish Mahadik 1Anish Mahadik 1 

Conditional formatting for Fieldset label

Hi All,

I am facing a problem to change the font color of fielset label based on conditional formatting.
<apex:outputLabel Value="{!reqField.Label}" styleClass="{!if(reqField.label=='Enter Business Unit if "Others"','green','red')}" />

Please help me on these. I am getting Expression unbalanced Error.

Thanks,
Anish
Best Answer chosen by Anish Mahadik 1
Raj VakatiRaj Vakati
Try something like below. Problem is with the Quoted String Escape Sequences  
 
<apex:outputText value="{!reqField.Label}" style="{!if(reqField.label='Enter Business Unit if \"Others\"','color:red;font-weight: bold', 'color:black')}"/>

 

All Answers

Raj VakatiRaj Vakati
Try something like below. Problem is with the Quoted String Escape Sequences  
 
<apex:outputText value="{!reqField.Label}" style="{!if(reqField.label='Enter Business Unit if \"Others\"','color:red;font-weight: bold', 'color:black')}"/>

 
This was selected as the best answer
Anish Mahadik 1Anish Mahadik 1
Hi Raj, 

Thanks for the reply. It is working but it is showing twice as it is fieldset.
User-added image

Please let me know how can i resolved it.

Thanks,
Anish
Raj VakatiRaj Vakati
Give me the complete code ... It's not coming from this line .. 
Anish Mahadik 1Anish Mahadik 1
Hi Raj,
Thank you so much. Sorry I didn't saw there was one more line for OutputText in my code because that it is reflecting twice.

Thanks,
Anish