js获取checkbox值拼接成字符串的方法:
function ck(){
var
$box = $("[name='box']:checked"),
val = '';
$.each($box,function (i,v){
val += i > 0 ? ","+v.value : v.value;
});
alert(val);
}
<!--下面是一个循环出checkbox的代码-->
<#list rolesList as user>
<li><label><input name="box" id="box" type="checkbox" value="${user.id }"></label></li>
</#list>