+ Start a Discussion
Bob_zBob_z 

Visualforce conditional formula

I am trying to figure out how to have a if statement on a visualforce page check for two words in a text field. If the conditions are true display a message. I cant firgure out how to do this correctly to work. Below is the code to the field that does not work. Any help would be greatly appreciated.
 
<div class="lost message" style="display:{!IF(AND(CONTAINS(Opportunity.Describe_what_you_need_quoted__c , "Acme"), CONTAINS(Opportunity.Describe_what_you_need_quoted__c , "Inc")),"","none")}" >
      <h2>Opportunity:This is an ACME Opportunity!              
 </h2>
    </div>

 
Best Answer chosen by Bob_z
VamsiVamsi
Hi Bob,

Make Use of the below it works !!

<div class="lost message" style="display:{!IF(CONTAINS(Opportunity.Describe_what_you_need_quoted__c , "Acme") && CONTAINS(Opportunity.Describe_what_you_need_quoted__c , "Inc"),"","none")}" >
      <h2>Opportunity:This is an ACME Opportunity!              
 </h2>
    </div>

Please mark as best answer if the above works .!!!!!!

All Answers

VamsiVamsi
Hi Bob,

Make Use of the below it works !!

<div class="lost message" style="display:{!IF(CONTAINS(Opportunity.Describe_what_you_need_quoted__c , "Acme") && CONTAINS(Opportunity.Describe_what_you_need_quoted__c , "Inc"),"","none")}" >
      <h2>Opportunity:This is an ACME Opportunity!              
 </h2>
    </div>

Please mark as best answer if the above works .!!!!!!
This was selected as the best answer
Bob_zBob_z
It Worked!