html代码:
应用一组
{% for peopel_1 in peopels_1 %}
{ { peopel_1.name }}
{% endfor %}
应用二组
{% for peopel_2 in peopels_2 %}
{ { peopel_2.name }}
{% endfor %}
提交
js代码:
1 获取已选中的名字并放到数组中
var name_list = [];
$("input[name='people_name']:checked").each(function(){
name_list.push($(this).val)
});
2 利用ajax向后台传递form表单数据
$(".select_people").submit(function(event){
event.preventDefault(); // 阻止默认表单的action功能
var name_list = [];
$("input[name='people_name']:checked").each(function(){
name_list.push($(this).val)
});
data = {'id': 1, 'names': name_list};
$.ajax({
url: "task_mgm/********",
type: "P