怎么把多条同名不同值 checkbox 写到另一张表?

浏览:846 发布日期:2013/12/13 分类:求助交流
我的 form 表单 :

    <form action="{:U('add')}" method="post">
        <table class="table">
            <tr >
                <td class="th" colspan="2">添加分组</td>
            </tr>
            <tr>
                <td>分组名称</td>
                <td><input type="text" class="input" name="cname"/></td>
            </tr>
            <tr>
                <td>权限组1</td>
                <td><input type="checkbox" value="1" name="qx"/>权限1  
                    <input type="checkbox" value="2" name="qx"/>权限2   
                    <input type="checkbox" value="3" name="qx"/>权限3</td>
            </tr>
            <tr>
                <td>权限组2</td>
                <td><input type="checkbox" value="4" name="qx"/>权限4  
                    <input type="checkbox" value="5" name="qx"/>权限5   
                    <input type="checkbox" value="6" name="qx"/>权限6</td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="submit" value="添加" class="input_button"/>
                    <input type="reset" class="input_button"/>
                </td>
            </tr>
        </table>
    </form>
我想把分组名称存到 Cate 表 , 然后把 权限组1 和 权限组2 里面被选中的 数据保存在 sign 表。 sign 表只记录 cid 和 qx 的值 (sign 表: qxID 自增,每个qx记录为一行,cid相同)

这个 Action 方法怎么写 ?
最佳答案
评论( 相关
后面还有条评论,点击查看>>