将复选框值保存到数据库[octobercms]

时间:2019-03-13 06:24:51

标签: octobercms octobercms-backend

如何将选定的复选框值保存为多个记录?

span { 
    display:inline-block;
    width:50px;
    background:blue;
    font-size:30px;
    color:white; 
    text-align:center;
}
<p><span>Foo</span><span>Bar</span></p>

这是我的AJAX处理程序- 并且此代码给出了错误“类型错误:函数参数太少” 当我添加span { display:inline-block; width:50px; background:blue; font-size:30px; color:white; text-align:center; }<p><span>Foo</span><span>Bar</span></p>时显示此错误。

{% for record in enrol.records %}
   <tr>
    <td>
       <label class="">
          <input type="checkbox" name="child[]" value="{{ record.id }}"> ({{ record.id }}) {{ record.firstname }}
       </label>
    </td>
  </tr>
{% endfor %}

1 个答案:

答案 0 :(得分:0)

像这样使用您的Ajax Handler方法,它将起作用

public function onPayment() {
    //get the child check box values
    $child = post('child',[]);
}

谢谢

相关问题