|
不知道是不是我RP不好,把CI手册里的代码复制粘贴到我的项目里就是不好用.
PHP复制代码
set_checkbox()
Permits you to display a checkbox in the state it was submitted. The first parameter must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:
<input type="checkbox" name="mycheck[]" value="1" <?php echo set_checkbox('mycheck[]', '1'); ?> />
<input type="checkbox" name="mycheck[]" value="2" <?php echo set_checkbox('mycheck[]', '2'); ?> />
复制代码
手册里这么写的,可到我这就记不住checked状态,只有checkbox复选框的name不是带[]的并且不重名的才好用.这该怎么办啊,我就需要用带[]的复选框啊.. |
|