Search code examples
javascriptif-statementcoldfusion-9

Coldfusion display only if content exist


If the value exist I would like to display the content otherwise not Any idea how to do it? with recordcount isn't working maybe over javascript? thank you for your tips

<div container>
<div class="panel-heading">
<div class="panel-default" style="background-color:##FFFFFF">
<div class="form-group"><cfoutput>#getinfo(SERVICES)#</cfoutput>  
</div>

Solution

  • you need to wrap the entire template inside the cfoutput

    <cfoutput>
     <cfif getinfo EQ "ZIP">
    
      <div class="form-group">
       #getinfo(SERVICES)#  
      </div>
    
     </cfif>
    </cfoutput>