父页面上取<iframe>内容元素

<!-- 查询客户信息 modal -->
    <div id="searchCusDiv" class="modal fade newadd" tabindex="-1"
         role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">

                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel">查询客户信息</h4>
                </div>
                <div class="modal-body">
                    <iframe id="CustomerForOrderInFo" src="" frameborder=0 framespacing=0
                            width="100%" scrolling="auto" height="600px" style="display: none"></iframe>
                </div>
                <div class="modal-footer">
                    <button id='searchCus_add' type="button" class="btn btn-primary">确认</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>

这里写图片描述

整个内容为一个模态框,<iframe>对应的内容蓝框包裹的内容

父页面取<iframe>里的内容

<input type='radio' dataId='" + data + "' class='idCheckbox' name='cus_id_checked' id='table_list_checkbox' />"

JS代码获取input内容

var selectedRows = $('#CustomerForOrderInFo').contents().find("input:radio[name='cus_id_checked']:checked");//CustomerForOrderInFo为iframe的id

if (selectedRows.length > 1) {
        system.alert("只能选择一个客户 ");
} else {
    var khId = selectedRows.attr("dataId");

其他调用问题请看

jQuery 父iframe与子iframe 相互调用传值:http://blog.csdn.net/wd4871/article/details/50517597

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值