+ Start a Discussion
BobBob 

visualforce conditional font color formula

I look for a way to change the color of a font with a formula depending on the survey responses of Excellent, Good, Fair.
my visualforce code is below. Any help would be aprreciated.



<apex:page standardController="Survey__c" showHeader="false">
  <apex:pageBlock title="Survey Questions"  >
 
 
 
<apex:panelGrid columns="1" >

<apex:outputLabel style="line-height:25px;font-weight:bold;padding:3px;border-bottom-style: solid; border-bottom-width: 1px;border-color:grey;box-shadow: 0px 0px 0px #888888" >1. Rate your overall experience with Cybex:</apex:outputLabel>

<apex:outputText style="line-height:25px;font-size:12px;padding-left:0px;"  value="{!Survey__c.Q1__c}"></apex:outputText>

<apex:outputLabel style="line-height:25px;font-weight:bold;padding:0px;border-bottom-style: solid; border-bottom-width: 1px;border-color:grey;box-shadow: 0px 0px 0px #888888" >2. Rate your overall experience with your Cybex Territory Manager/Sales Representative:</apex:outputLabel>
<apex:outputText style="line-height:25px;font-size:12px;padding-left:0px"  value="{!Survey__c.Q2__c}"></apex:outputText>

<apex:outputLabel style="line-height:25px;font-weight:bold;padding:0px;border-bottom-style: solid; border-bottom-width: 1px;border-color:grey;box-shadow: 0px 0px 0px #888888" >3. Rate your overall experience with the Cybex order process</apex:outputLabel>
<apex:outputText style="line-height:25px;font-size:12px;padding-left:0px"  value="{!Survey__c.Q3__c}"></apex:outputText>

<apex:outputLabel style="line-height:25px;font-weight:bold;padding:0px;border-bottom-style: solid; border-bottom-width: 1px;border-color:grey;box-shadow: 0px 0px 0px #888888" >4. Did Cybex handle the delivery and/or installation of your equipment?</apex:outputLabel>
<apex:outputText style="line-height:25px;font-size:12px;padding-left:0px"  value="{!Survey__c.Q4__c}"></apex:outputText>

<apex:outputLabel style="line-height:25px;font-weight:bold;padding:0px;border-bottom-style: solid; border-bottom-width: 1px;border-color:grey;box-shadow: 0px 0px 0px #888888" >5. Did your Cybex equipment arrive on schedule?</apex:outputLabel>
<apex:outputText style="line-height:25px;font-size:12px;padding-left:0px"  value="{!Survey__c.Q5__c}"></apex:outputText>

<apex:outputLabel style="line-height:25px;font-weight:bold;padding:3px;border-bottom-style: solid; border-bottom-width: 1px;border-color:grey;box-shadow: 0px 0px 0px #888888" >6. If you requested to be contacted prior to delivery, were you?</apex:outputLabel>
<apex:outputText style="line-height:25px;font-size:12px;padding-left:0px"  value="{!Survey__c.Q6__c}"></apex:outputText>

<apex:outputLabel style="line-height:25px;font-weight:bold;padding:3px;border-bottom-style: solid; border-bottom-width: 1px;border-color:grey;box-shadow: 0px 0px 0px #888888" >7. Did the installers test the equipment?</apex:outputLabel>
<apex:outputText style="line-height:25px;font-size:12px;padding-left:0px"  value="{!Survey__c.Q7__c}"></apex:outputText>

<apex:outputLabel style="line-height:25px;font-weight:bold;padding:3px;border-bottom-style: solid; border-bottom-width: 1px;border-color:grey;box-shadow: 0px 0px 0px #888888">8. Was your equipment intact and undamaged?</apex:outputLabel>
<apex:outputText style="line-height:25px;font-size:12px;padding-left:0px"  value="{!Survey__c.Q8__c}"></apex:outputText>


<apex:outputLabel style="line-height:25px;font-weight:bold;padding:3px;border-bottom-style: solid; border-bottom-width: 1px;border-color:grey;box-shadow: 0px 0px 0px#888888" >9. Was the installation team courteous?</apex:outputLabel>
<apex:outputText style="line-height:25px;font-size:12px;padding-left:0px"  value="{!Survey__c.Q9__c}"></apex:outputText>


<apex:outputLabel style="line-height:25px;font-weight:bold;padding:3px;border-bottom-style: solid; border-bottom-width: 1px;border-color:grey;box-shadow: 0px 0px 0px #888888" >10. Was your order complete?</apex:outputLabel>
<apex:outputText style="line-height:25px;font-size:12px;padding-left:0px"  value="{!Survey__c.Q10__c}"></apex:outputText>


<apex:outputLabel style="line-height:25px;font-weight:bold;padding:3px;border-bottom-style: solid; border-bottom-width: 1px;border-color:grey;box-shadow: 0px 0px 0px #888888" >11. Was the equipment functioning properly?</apex:outputLabel>
<apex:outputText style="line-height:25px;font-size:12px;padding-left:0px"  value="{!Survey__c.Q11__c}"></apex:outputText>


<apex:outputLabel style="line-height:25px;font-weight:bold;padding:3px;border-bottom-style: solid; border-bottom-width: 1px;border-color:grey;box-shadow: 0px 0px 0px #888888" >12. Did Cybex follow up with a phone call?</apex:outputLabel>
<apex:outputText style="line-height:25px;font-size:12px;padding-left:0px"  value="{!Survey__c.Q12__c}"></apex:outputText>



</apex:panelGrid>
</apex:pageBlock>
</apex:page>

 
dev_sfdc1dev_sfdc1
Hi Bob,

Set if condition using style attribute to render different colors.Please refer the link below:

https://developer.salesforce.com/forums/ForumsMain?id=906F000000099PiIAI

https://developer.salesforce.com/forums/ForumsMain?id=906F000000098Y1IAI

Please let me know if this helps you.

Thank You