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
Karina ChangKarina Chang 

IF Statement in Visualforce page

Hi,
I am trying to find out if it is possible to display an integer on a visualforce page.
For example, if my Opportunity field (Vertical__c) is "ABC", I want to display 3. If it isn't, it should display 0.

Is this possible? Do I need a Controller?
JeffreyStevensJeffreyStevens
Are you displaying a length of 3, or just a number ?  So it would always be zero or three?

If that's the case  - then I think it's...

<apex:outputText value="{!if(vertical__c=='ABC',"3","0")}" />

Wouldn't that do it?
Karina ChangKarina Chang
It does!! Thanks! 
(I tried this yesterday, but there was an error in my syntax) =)