【发布时间】:2017-12-28 06:46:17
【问题描述】:
我的表格由 15 条记录组成,分为 2 页,但是,第一页中的那些单选按钮将不会被选中,如下图所示。
这里是查看页面中使用的代码:
<?php foreach($rights->result() as $row){
echo "<label class='radio-inline'><input type='radio' name='rightRBtn[".$perm_id."]' value='$row->id'".(($row->id == $right_id) ? " checked='checked'":'')." />" . $row->description."</label>";
}?>
浏览器源视图显示单选按钮框实际上也被选中。
<td><label class='radio-inline'><input type='radio' name='rightRBtn[22]' value='0' checked='checked' />none</label><label class='radio-inline'><input type='radio' name='rightRBtn[22]' value='1' />view</label> </td>
有谁知道问题出在哪里?
【问题讨论】:
-
是的,但是输出还是一样的。
-
array(2) { [0]=> object(stdClass)#51 (2) { ["id"]=> string(1) "0" ["description"]=> string (4) "none" } [1]=> object(stdClass)#52 (2) { ["id"]=> string(1) "1" ["description"]=> string(4) "view" } } 这是 $right_id --> 1
-
会是引导程序问题还是数据表问题?因为我尝试使用纯 html 代码,单选按钮也没有选中。
-
不,它在本地运行。
-
没关系,谢谢你的帮助。
标签: php html codeigniter datatables-1.10