自动检查单选按钮

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>
douyan8961
douyan8961 这篇文章对我有用。使用jQuery在页面加载时自动单击按钮元素
11 个月之前 回复
duanmaduan1848
duanmaduan1848 我也这么认为:-D
11 个月之前 回复
douling1936
douling1936 对我来说它看起来像CakePHP。这是由Blesta制作的,他声称这是MinPHP。
11 个月之前 回复
duancutan4770
duancutan4770 Min-PHP是脚本的构建方式。
11 个月之前 回复
dongyi6543
dongyi6543 正在使用CakePHP?
11 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问