如何设置codeigniter中的复选框的值并显示选中状态? [英] How to set value of checkbox in codeigniter and show checked state?
本文介绍了如何设置codeigniter中的复选框的值并显示选中状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一系列的复选框在codeigniter,需要显示检查的状态和值,当表单提交。
I have a series of checkboxes in codeigniter and need to show the checked state and value when a form is submitted.
我如何做到这一点?我已经阅读了codeigniter网站的文档,但看不到如何设置检查状态?
How can I do this?? I have read the documentation of the codeigniter website but cannot see how to set the checked state?
这是我的代码:
<?php echo form_checkbox('spa', 'y', FALSE, '') ?>
推荐答案
使用:
echo form_checkbox('spa', 'y', TRUE); //TRUE sets it as checked
strong> in codeigniter 用户指南
See: form_checkbox() in codeigniter user guide
这篇关于如何设置codeigniter中的复选框的值并显示选中状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文