dongnaizao8039 2019-02-11 17:26
浏览 74

自动检查单选按钮

I'm trying to edit a form so that when I open it, a radio button is selected for me. I've tried several options and have gotten the button to select but, when submitting the form, it acts as if the radio button isn't selected.

Any ideas?

<div class="col-md-<?php $this->Html->_($column_widths);?>">
    <h4><?php echo $this->Html->ifSet($options_heading);?></h4>
    <?php
    // Set non-merchant gateways
    foreach ($this->Html->ifSet($nm_gateways, []) as $gateway) {
    ?>
        <div class="radio">
            <label>
                <?php
                $this->Form->fieldRadio('gateway', 'checked', $this->Html->ifSet($gateway->id), ($this->Html->ifSet($vars->pay_with) == $this->Html->ifSet($gateway->id)), ['class' => 'gateway']);
                $this->Html->_($gateway->name);
                ?>
            </label>
        </div>
    <?php
    }
    ?>
</div>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
    • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
    • ¥30 python代码,帮调试
    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python
    • ¥15 要给毕业设计添加扫码登录的功能!!有偿
    • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
    • ¥15 微信公众号自制会员卡没有收款渠道啊