Search code examples
javascriptjqueryjquery-templates

Jquery tmpl creating a or statement


{{if production_country != null || production_year != null}}
    <h3 class="heading">Details</h3>
    <p><b>${production_country} ${production_year}</b>, {{html roles}}</p>
{{/if}}

How can i create a OR statement. This doesnt works in my jquery template..


Solution

  • Instead of:

    {{if production_country != null || production_year != null}}
    

    Use:

    {{if production_country !="" OR production_year !=""}}
    

    I am unsure from your question if you need to determine the values of production_country and production_year. eg production_year.value!=""

    see this question:

    jQuery: checking if the value of a field is null (empty)