1 回答
TA贡献1830条经验 获得超9个赞
<script>
$('.form-check-input').on('click', function() {
const menuId = $(this).data('menu');
const roleId = $(this).data('role'); // roleId = <? $role[‘id’] ?> so php did not echo role id here
$.ajax({
url: "<?= base_url('admin/changeaccess'); ?>",
type: 'post',
data: {
menuId: menuId,
roleId: roleId
},
success: function() {
document.location.href = "<?= base_url('admin/roleaccess/'); ?>" + roleId;
}
});
});
</script>
对于解决方案,请更改您的form-check-input元素
<... class=“form-check-input” data-role=“<?php echo $role[‘id’]; ?>” data-menu=“echo menu variable” ...>
如果这样无法共享form-check-input按钮的html
- 1 回答
- 0 关注
- 130 浏览
添加回答
举报