-1
我試圖根據從服務器傳遞到視圖的數據來檢查單選按鈕。但是我無法在引導表中檢查單選按鈕。以下是我的代碼:無法顯示錶格中的選中單選按鈕
<tbody>
<?php
foreach($results as $row)
{
?>
<tr>
<td><?php echo $row->productCoverNoteNo ?></td>
<td><?php echo $row->productClass ?></td>
<td><?php echo $row->productName ?></td>
<td><?php echo $row->productPolicyNo ?></td>
<td>
<input type="radio" name="tbx_paymentStatus" id="paid" value="PAID" <?php if ($row->productPaymentStatus == "UNPAID"){ echo "checked='checked'"; }?> />
<label for="paid">Paid</label></br>
<input type="radio" name="tbx_paymentStatus" id="unpaid" value="UNPAID" <?php if ($row->productPaymentStatus == "PAID"){ echo "checked='checked'"; }?> />
<label for="unpaid">Unpaid</label>
</td>
<td><a title="Edit this customer product" href="<?php echo base_url("customerProduct/editCustomerProduct/$row->productCoverNoteNo") ?>"><i class="fa fa-pencil fa-lg"></i></a>
| <a title="View endorsements of this customer product" href="<?php echo base_url("endorsement/viewEndorsement/$row->productCoverNoteNo") ?>"><i class="fa fa-book fa-lg"></i></a></td>
</tr>
<?php echo($row->productPaymentStatus);
}
?>
</tbody>
使用echo '檢查= 「檢查」';有單引號和雙引號問題 –
試過..我不會顯示太。 – John
檢查你的變量的值可能是不同的情況下 –