<tfoot id='PGDFe'></tfoot>

  • <i id='PGDFe'><tr id='PGDFe'><dt id='PGDFe'><q id='PGDFe'><span id='PGDFe'><b id='PGDFe'><form id='PGDFe'><ins id='PGDFe'></ins><ul id='PGDFe'></ul><sub id='PGDFe'></sub></form><legend id='PGDFe'></legend><bdo id='PGDFe'><pre id='PGDFe'><center id='PGDFe'></center></pre></bdo></b><th id='PGDFe'></th></span></q></dt></tr></i><div id='PGDFe'><tfoot id='PGDFe'></tfoot><dl id='PGDFe'><fieldset id='PGDFe'></fieldset></dl></div>
          <bdo id='PGDFe'></bdo><ul id='PGDFe'></ul>
      1. <small id='PGDFe'></small><noframes id='PGDFe'>

        <legend id='PGDFe'><style id='PGDFe'><dir id='PGDFe'><q id='PGDFe'></q></dir></style></legend>

        输入按钮不提交表单(仅限 IE)ASP.NET

        时间:2023-06-10

        <i id='vOIss'><tr id='vOIss'><dt id='vOIss'><q id='vOIss'><span id='vOIss'><b id='vOIss'><form id='vOIss'><ins id='vOIss'></ins><ul id='vOIss'></ul><sub id='vOIss'></sub></form><legend id='vOIss'></legend><bdo id='vOIss'><pre id='vOIss'><center id='vOIss'></center></pre></bdo></b><th id='vOIss'></th></span></q></dt></tr></i><div id='vOIss'><tfoot id='vOIss'></tfoot><dl id='vOIss'><fieldset id='vOIss'></fieldset></dl></div>
        <legend id='vOIss'><style id='vOIss'><dir id='vOIss'><q id='vOIss'></q></dir></style></legend>

        • <bdo id='vOIss'></bdo><ul id='vOIss'></ul>

            • <small id='vOIss'></small><noframes id='vOIss'>

                <tbody id='vOIss'></tbody>
              <tfoot id='vOIss'></tfoot>
                1. 本文介绍了输入按钮不提交表单(仅限 IE)ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个带有文本框和按钮的表单.IE 是唯一在按下 Enter 时不会提交表单的浏览器(适用于 FF、Opera、Safari、Chrome 等).我发现这个 javascript 函数试图哄骗 IE 行为;但无济于事:

                  I have a form with a textbox and a button. IE is the only browser that will not submit the form when Enter is pressed (works in FF, Opera, Safari, Chrome, etc.). I found this javascript function to try to coax IE into behaving; but no avail:

                  function checkEnter(e){
                      var characterCode
                      if (e && e.which) {
                          e = e
                          characterCode = e.which
                      } else {
                          e = event
                          characterCode = e.keyCode
                      }
                      if (characterCode == 13) {
                          document.forms[0].submit()
                          return false
                      } else {
                          return true
                      }
                  }
                  

                  实施:

                  searchbox.Attributes("OnKeyUp") = "checkEnter(event)"
                  

                  有什么建议吗?

                  此页面在CodeProject 概括了 Dillie 所说的内容,而且效果很好.

                  This page on CodeProject outlines what Dillie was saying, and it works perfectly.

                  推荐答案

                  我过去做的另一件事是将表单区域包装在 Panel 中,并将 DefaultButton 属性设置为您拥有的提交按钮.只要您在面板区域中有一个表单元素处于焦点位置,这就会有效地将 enter 键映射到提交.

                  The other thing I have done in the past is wrap the form area in a Panel and set the DefaultButton attribute to the submit button you have. This effectively maps the enter key to the submission as long as you have a form element in focus in the panel area.

                  这篇关于输入按钮不提交表单(仅限 IE)ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何用默认文本填充空文本框? 下一篇:如何动态生成 TextBox 控件.

                  相关文章

                    <legend id='zUkxQ'><style id='zUkxQ'><dir id='zUkxQ'><q id='zUkxQ'></q></dir></style></legend>
                  1. <tfoot id='zUkxQ'></tfoot>
                  2. <small id='zUkxQ'></small><noframes id='zUkxQ'>

                    <i id='zUkxQ'><tr id='zUkxQ'><dt id='zUkxQ'><q id='zUkxQ'><span id='zUkxQ'><b id='zUkxQ'><form id='zUkxQ'><ins id='zUkxQ'></ins><ul id='zUkxQ'></ul><sub id='zUkxQ'></sub></form><legend id='zUkxQ'></legend><bdo id='zUkxQ'><pre id='zUkxQ'><center id='zUkxQ'></center></pre></bdo></b><th id='zUkxQ'></th></span></q></dt></tr></i><div id='zUkxQ'><tfoot id='zUkxQ'></tfoot><dl id='zUkxQ'><fieldset id='zUkxQ'></fieldset></dl></div>

                    • <bdo id='zUkxQ'></bdo><ul id='zUkxQ'></ul>