无法在表

时间:2015-05-18 10:20:42

标签: php html radio-button

我正在尝试根据从服务器传递到视图的数据来检查单选按钮。但是我无法在引导程序表中检查单选按钮。以下是我的代码:

<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>

1 个答案:

答案 0 :(得分:0)

试试这个:
    <input type="radio" name="tbx_paymentStatus" id="paid" value="PAID" <?php if ($row->productPaymentStatus == "UNPAID"){ ?> checked='checked' <?php }?> />