获取bootstrap中模态框选中的复选框后面的label里面的值,点击确定后在父页面动态创建列表,用jq或js 20
1个回答
展开全部
1.Bootstrap模态框
<button type="button" id="datatarget" class="btn btn-primary btn-sm"
data-toggle="modal" data-target="#Modales"onclick="check();">登记</button>
<div class="modal fade" id="datatarget" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document"
style="width: 20%; margin-top: 15%">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">你确定要登记选中的记录吗</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<a class="btn btn-primary" href="user/registerver.do" role="button">确定
</a>
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
</div>
</div>
</div>
</div>
2.判断checkbox被选中的个数
<script type="text/javascript">
$("input[name='ifAll']:checked").length )
</script>
<input type="checkbox" name="ifAll">
<button type="button" id="datatarget" class="btn btn-primary btn-sm"
data-toggle="modal" data-target="#Modales"onclick="check();">登记</button>
<div class="modal fade" id="datatarget" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document"
style="width: 20%; margin-top: 15%">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">你确定要登记选中的记录吗</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<a class="btn btn-primary" href="user/registerver.do" role="button">确定
</a>
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
</div>
</div>
</div>
</div>
2.判断checkbox被选中的个数
<script type="text/javascript">
$("input[name='ifAll']:checked").length )
</script>
<input type="checkbox" name="ifAll">
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询