//隐患选择弹出框
function func12(url, title) {
//iframe层
layer.open({
type: 2,
skin: 'layui-layer-lan',
title: title,
closeBtn: 1,
shadeClose: false,
shade: [0.3, '#fff'],
area: ['90%', '90%'],//跳转到的那个页面的相对本页面的大小
anim: -1,
content: url,
btn: ['确认', '取消'],
yes: function (index) {
//alert("0000");
var res = window["layui-layer-iframe" + index].callbackdata();//回调
//alert(">>>>" + res);
document.getElementById("hiddenRoles").value = res;//把hiddenRoles文本框的值给res
layer.close(index);
},
cancel: function () {
}
});
return false;
}
在跳转到的页面中:
var callbackdata = function () {
var chk_value = '';
$("input[type='checkbox']:checked").each(function () {
chk_value += $(this).val() + ',';
});
if (chk_value.length > 0) {
chk_value = chk_value.substring(0, chk_value.length - 1);
}
return chk_value;
}
推荐相似文章链接:http://www.45fan.com/article.php?aid=19090285057899899332213187