【发布时间】:2018-06-05 14:38:15
【问题描述】:
表格 HTML
<table id="example3" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th></th>
<th>Nama</th>
<th>Unit</th>
</tr>
</thead>
</table>
Javascript 标题选择行
$('#frm-example').on('submit', function(e){ //on submit
var form = this;
var rows_selected = table3.column(0).checkboxes.selected();
// Iterate over all selected checkboxes
$.each(rows_selected, function(index, rowId){
// Create a hidden element
$(form).append(
$('<input>')
.attr('type', 'hidden')
.attr('name', 'id[]')
.val(rowId)
);
});
我的数据库
+-----------+--------------+---------------+-----------+-------------+-----------+------------------------------+---------------------+
| id_survey | judul_survey | status_survey | id_target | id_kategori | responden | detail_target | tgl_survey |
+-----------+--------------+---------------+-----------+-------------+-----------+------------------------------+---------------------+
| 130 | tes | terbit | 3 | 2 | 2 | 198411162009101002,H76215021 | 2017-12-19 15:08:35 |
+-----------+--------------+---------------+-----------+-------------+-----------+------------------------------+---------------------+
1 row in set (0.07 sec)
detail_kategori 字段中的数据复选框,我如何将其放入表单复选框以进行更新?
好的,我从这里得到代码复选框https://jsfiddle.net/gyrocode/07Lrpqm7/ 我要修改代码来编辑
【问题讨论】:
-
不知道你在问什么
-
好的,我从这里jsfiddle.net/gyrocode/07Lrpqm7 获取代码复选框。我要修改代码来编辑
-
您要编辑选定行的值...?
-
是的先生,我想编辑选定的行
-
您显示的 HTML 中没有复选框。
标签: javascript php jquery html checkbox