You need to sign in to do that
Don't have an account?
Durai Saravanan
background color of a div, based on if statement
Hi,
Good day!
I have a integer variable 'c_status ' in my controller. And in my visualforce page, the backrgound color of a particular div must be based on the value of 'c_status '., like,
if 'c_status ' == 1 , my background color must be green
else if 'c_status ' == 2, my background color must be yellow
else if 'c_status ' == 3, my background color must be red
How should i do that?
My visualforce page :
Please suggest me some ideas on this.
Thanks in advance,
Durairaj
Good day!
I have a integer variable 'c_status ' in my controller. And in my visualforce page, the backrgound color of a particular div must be based on the value of 'c_status '., like,
if 'c_status ' == 1 , my background color must be green
else if 'c_status ' == 2, my background color must be yellow
else if 'c_status ' == 3, my background color must be red
How should i do that?
My visualforce page :
<apex:page controller="Monthly_review_VFC" action="{!execute}" sidebar="false" > <head> <style type="text/css" media="screen"> html, body{ margin:0px; padding:0px; height:100%; overflow:hidden; } </style> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body style="overflow:auto"> <h1>Monthly Review:</h1> <br/> Click on the particular account to get their performance in last month <br/><br/> <apex:form> <div class="container"> <div class="well" style = "background-color:black; color: white; margin-right: 100px;" >Arthur J. Gallagher & Co.<br/> <apex:commandButton Value="Gantt Chart" action="/apex/Gantt_Chart"/> </div> <div class="well" >RPX Corporation<br/> <!-- The condition should be for this tag --> <apex:commandButton Value="Gantt Chart" action="/apex/Gantt_Chart"/> </div> <div class="well">CredHub<br/> <apex:commandButton Value="Gantt Chart" action="/apex/Gantt_Chart"/> </div> <div class="well">Valet Living<br/> <apex:commandButton Value="Gantt Chart" action="/apex/Gantt_Chart"/> </div> <div class="well">Healthy Paws Pet Insurance<br/> <apex:commandButton Value="Gantt Chart" action="/apex/Gantt_Chart"/> </div> </div> </apex:form> </body> </apex:page>My Controller:
public class Monthly_review_VFC { Integer c_status {get; set;} public void execute() { Integer c_status = 1; } }
Please suggest me some ideas on this.
Thanks in advance,
Durairaj
I tried your solution, but am getting this error
Thanks,
Durairaj