Reputation: 111
How can I hide this row if the variable $status
is equal to 'Delivered'
?
<?php if ($status == 'Delivered') { ?>
<tr>
<td class="normalfont" >Reason for failed delivery:</td>
<td><input type="text"
STYLE="color: #0000; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #E1E5E6;"
size="50" class="frmSearch" name="courier_del_reason"
readonly="readonly"
value="<?=$objResult["courier_del_reason"];?>" /></td>
</tr>
<?php }?>
I've used some codes but still it didn't work.
Upvotes: 1
Views: 118
Reputation: 33512
I am hoping that by column, you mean table row (given that is what the code you have given does) in which case it is a simple change of the condition:
<?php if ($status != 'Delivered') { ?>
// ^ This bit was changed.
<tr>
<td class="normalfont" STYLE="font-family: Verdana;">Reason for failed delivery:</td>
<td><input type="text"
STYLE="color: #0000; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #E1E5E6;"
size="50" class="frmSearch" name="courier_del_reason"
readonly="readonly"
value="<?=$objResult["courier_del_reason"];?>" /></td>
</tr>
<?php }?>
The code will now only execute this bit of the value of $status
is not 'Delivered'
.
Upvotes: 2