IE9和IE10不支持回车事件,谷歌和IE11支持

star-x 发布于 2016/05/16 12:42
阅读 605
收藏 0
IE

下面代码在IE9和IE10里面回车事件不支持 求大神帮忙求解决方法

<!DOCTYPE html>
<html lang="zh-cn">
<head id="header1" runat="server">
    <title></title>
    <script type="text/javascript" src="../js/tp.js.ashx"></script>
    <script type="text/javascript" src="../js/tp.core.unpack.js"></script>

    <style type="text/css">
        body {
            background-color: #f9f9f9;
        }

        .ItemsTable #spc_ctl01 {
            text-align: left;
        }

        .ItemsTable #spc_ctl02 {
            text-align: left;
        }

        .ItemsTable #spc_ctl03 {
            text-align: left;
        }

        .ItemsTable #spc_ctl04 {
            text-align: left;
        }

        .ItemsTable #spc_ctl05 {
            text-align: left;
        }

        .ItemsTable #spc_ctl09 {
            text-align: left;
        }

        .ItemsTable #spc_ctl10 {
            text-align: left;
        }

        .ItemsTable #spc_ctl11 {
            text-align: left;
        }

        .ItemsTable #spc_ctl12 {
            text-align: left;
        }

        #Panel1 .btn_normal {
            width: 80px;
            height:30px;
            font-size:15px;
        }

        .chkstyle input {
            position: relative;
            top: 3px;
        }

        #mp1 {
            height: 360px !important;
            z-index: 1;
        }

        #search-side {
           /* width:500px!important;*/
            height: 360px !important;
            width:100%;
        }
        #tree-side + #search-side {
            padding-left:9px;
        }
        #tree-side {margin-left:5px;}
        .chkstyle label {
            position: relative;
            top: 3px;
        }
        #gic{padding-right:23%!important;}   
        table #tree-side{height:393px;}
        #spm{border: 1px solid rgb(194, 211, 223); width: 100%;}
        #spc .FilterItem{text-align:left;}
        fieldset .FilterItem .vch-DateSelectDropDown,fieldset .FilterItem .vch-DateSelectDropDownMouseOver,fieldset .FilterItem .v-editor,fieldset .FilterItem .v-editor-edit,fieldset .FilterItem .v-editor-readonly{float:none;}
        #fic{overflow:hidden!important;}
        #spm_spmdlg input[type="checkbox"]{margin-top:0;}
        #spm_spmdlg{height:100px!important;}
        .v-editor input[type=hidden]{color:inherit;}
    </style>
    <base target="_self" />
</head>
<body>
    <form id="form1" runat="server" style="width:100%;overflow:hidden;">
        <!-- 页面容器 -->
        <div id="pageContainer" style="visibility: hidden">
            <!-- 查询 -->
            <div id="filter">
                <cc2:ReportSearchControl ID="ReportSearchControl1" runat="server" Height="415px"
                    Width="680px">
                </cc2:ReportSearchControl>
            </div>
            <div id="operation" style="clear: both; position:absolute;right:10px;bottom:10px;">
                <span style="float: left; display: none; visibility: hidden;">
                    <!-- 滤设按钮 -->
                    <asp:Button ID="SetFilter" runat="server" class="btn_normal" OnClientClick="return RptSearchEventEntry('ReportFilterSet');" />
                </span><span style="float: left; display: none; visibility: hidden;">
                    <asp:Button ID="btnColumnSet" Text="设 置" class="btn_normal" runat="server" Width="100px" OnClientClick="return RptSearchEventEntry('ReportColumnSet');" />
                </span><span style="float: left">
                    <asp:Panel ID="Panel1" runat="server">
                    </asp:Panel>
                </span>
                <span style="float: right;">
                    <span id="spnExport" style="margin-right: 8px; float: left; visibility: hidden;">
                        <!-- hanruia导出 -->
                        <asp:Button ID="btnExport" runat="server" class="btn_normal" OnClientClick="return RptSearchEventEntry('ExportReportData');"
                            AccessKey="o" Text="导出" />
                    </span>
                    <span style="margin-right: 8px">
                        <!-- 发布应用按钮 -->
                        <asp:Button ID="btnCreateApp" runat="server" class="btn_normal" OnClientClick="return RptSearchEventEntry('CreateAppClick');"
                            AccessKey="o" />
                    </span>
                    <span style="margin-right: 8px">
                        <!-- 取消应用按钮 -->
                        <asp:Button ID="btnCancelApp" runat="server" class="btn_normal" OnClientClick="return RptSearchEventEntry('CancelAppClick');"
                            AccessKey="o" />
                    </span>
                    <span style="margin-right: 8px">

                        <!-- 查询按钮 -->
                        <asp:Button ID="Search" runat="server" class="btn_normal big" OnClientClick="return RptSearchEventEntry('OkClick');"
                            AccessKey="o" />
                    </span>
                    <span style="margin-right: 8px">
                        <!-- 图表 -->
                        <asp:Button ID="btnChart" runat="server" class="btn_normal big" OnClientClick="return RptSearchEventEntry('ChartClick');"
                            AccessKey="o" />
                    </span>
                    <span>
                        <!-- 取消按钮 -->
                        <asp:Button ID="btnCancel" runat="server" class="btn_normal big" OnClientClick="return RptSearchEventEntry('CancelClick');"
                            AccessKey="c" />
                    </span>
                </span>
            </div>
            <div id="tips" style="clear: both; margin-left: 5px; margin-right: 5px; margin-top: 10px; display: none; visibility: hidden;">
                <asp:Label ID="reportSearch_Tip" Style="color: #c13003" runat="server">
                </asp:Label>
            </div>
        </div>
        <!--注册脚本容器-->
        <div id="scriptContainer" runat="server">
        </div>
    </form>
    <script type="text/javascript">
        $(document).ready(function () {
            if (document.getElementById("ctl11_div")) {
                document.getElementById("ctl11_div").style.width = "98%";
            };
            RptSearchEventEntry('LoadContainer');
            $(document).on('keypress', function () { RptSearchEventEntry('KeyPress') });
            $("#spm").css({ "height": "392px" });

            // 不是ie补充一段回车切换焦点控制,这里需用重构成统一控制,重构到哪还需要研究
            if (!window.ActiveXObject || window.ActiveXObject) {
                function controlTabEnter(selectFirst) {
                    //16.5.9 添加查询id
                    var inputs = $('#search-side:visible input:visible, #search-side:visible textarea:visible, #Search:visible');
                    if (selectFirst) inputs.first().focus();
                    inputs.keydown(function (e) {
                        if ((e.keyCode != 13 && e.keyCode != 9) || e.target.type == "textarea")
                            return;
                        var isnext = false
                        inputs.each(function (i, item) {
                            if (isnext) {
                                if ($(item).prop("readonly"))
                                    return true;
                                try {
                                    $(item).focus();  // todo: checkbox选不上
                                } catch (e) {
                                    return true
                                }
                                return false;
                            }
                            if (item == e.target) {
                                isnext = true;
                            }
                        });
                    });
                }

                $('.tabstrip').click(function () {
                    controlTabEnter(true);
                });

                controlTabEnter(true);
            }
        })

    </script>
    <style>
        #spm_chkIsPublic {
            position: relative;
            top: 3px;
        }

        #spm_chkIsDefault {
            position: relative;
            top: 3px;
        }

        #spm_btnSave {
            margin-right: 10px;
        }
    </style>
</body>
</html>

加载中
返回顶部
顶部