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
Rick MacGuiganRick MacGuigan 

How to add color to the label of an inputField

I can change the text entry color of an inputField . How can I change the lable for this inputField that shows up within the pageBlockSection ?

 <apex:inputField id="fieldtest" value="{!a.Other_Policy_term__c}" style="color:red;" rendered="{!a.Policy_Term__c="other" }" />
Balaji BondarBalaji Bondar
Hi Rick,

This code may help:
<apex:pageBlockSection title="My Content Section" columns="2">
	<apex:pageBlockSectionItem>
		<apex:outputLabel value="XXXXXXXXXXXX"  rendered="{!a.Policy_Term__c="other" }"/>
		<apex:inputField id="fieldtest" value="{!a.Other_Policy_term__c}" style="color:red;" rendered="{!a.Policy_Term__c="other" }" />
	</apex:pageBlockSectionItem>
</apex:pageBlockSection>

Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.
Rick MacGuiganRick MacGuigan
Balaji - I am interested in applying color to the label . When using an ouputLabel the label it self becomes left aligned and not next to the input field itself. So I was thinking about working with the inputField to change its labels color.
Srikanth Challa 3Srikanth Challa 3
Here is the Solution!
<style type="text/css"> redText { color: red; } </style>
<apex:inputField value="{!Account.Name}" label="<redText>Acct Name</redText>"/>