BioloMICS logo
×
BioloMICS Web Menu

Only show title and value when value is yes

 
This example uses a C field with 5
 
If the subfield value = yes then show the name.
Otherwise do nothing.
In the example below, the title is only shown when at least one of the subfields is Yes.
 
<div class="row">
     @if(@Model.C1782.C1782_0.ToString() == "yes" || @Model.C1782.C1782_1.ToString() == "yes" || @Model.C1782.C1782_2.ToString() == "yes" || @Model.C1782.C1782_3.ToString() == "yes" || @Model.C1782.C1782_4.ToString() == "yes"){
    <div class="col-sm-4 col-lg-3">
            <span>Textile</span>
    </div>}
    <div class="col-sm-8 col-lg-8">
        @{if(@Model.C1782.C1782_0.ToString() == "yes") <p>Oeufs</p>}
        @{if(@Model.C1782.C1782_1.ToString() == "yes") <p>Larves</p>}
        @{if(@Model.C1782.C1782_2.ToString() == "yes") <p>Nymphes</p>}
        @{if(@Model.C1782.C1782_3.ToString() == "yes") <p>Adultes</p>}
        @{if(@Model.C1782.C1782_4.ToString() == "yes") <p>Non determiné</p>}
    </div>
</div>