<small id='oNL9V'></small><noframes id='oNL9V'>

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

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

      1. Jquery 在 Enter 键上选择 NEXT 文本字段

        时间:2023-09-07

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

            • <tfoot id='ZPCj1'></tfoot>

              <small id='ZPCj1'></small><noframes id='ZPCj1'>

              <legend id='ZPCj1'><style id='ZPCj1'><dir id='ZPCj1'><q id='ZPCj1'></q></dir></style></legend>
              • <bdo id='ZPCj1'></bdo><ul id='ZPCj1'></ul>

                    <tbody id='ZPCj1'></tbody>
                1. 本文介绍了Jquery 在 Enter 键上选择 NEXT 文本字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我使用 jquery 创建了一个页面,加载时它会自动选择第一个文本字段.我希望它在按下 ENTER 键时移动到下一个字段.

                  I have made a page using jquery, and on load it selects the first text field automatically. I want it to then move to the next field when the ENTER key is pressed.

                  $('.barcodeField input').bind('keyup', function(event) {
                      if(event.keyCode==13){
                         $("this + input").focus();     
                      }
                  });
                  

                  我在网上找不到任何有效的东西.我已经搜索了论坛.

                  I can't find anything that works on the net. And I've scoured the forums.

                  推荐答案

                  我创建了一个小函数,可以满足你的需求.这是我使用的版本,因此您可能需要更改类名,但您应该明白了.

                  I've created a little function which can do what you need. This is the version I use so you may need to change the class names but you should get the idea.

                  <script type="text/javascript">
                  $(document).ready(function(){
                  $(".vertical").keypress(function(event) {
                          if(event.keyCode == 13) { 
                          textboxes = $("input.vertical");
                          debugger;
                          currentBoxNumber = textboxes.index(this);
                          if (textboxes[currentBoxNumber + 1] != null) {
                              nextBox = textboxes[currentBoxNumber + 1]
                              nextBox.focus();
                              nextBox.select();
                              event.preventDefault();
                              return false 
                              }
                          }
                      });
                  })
                  </script>
                  

                  所以基本上:-

                  • 获取所有匹配 .vertical 的输入字段
                  • 查找当前文本框
                  • 寻找下一个
                  • 将焦点放在那个上

                  这篇关于Jquery 在 Enter 键上选择 NEXT 文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何查找特定密钥的密钥代码 下一篇:数字+空格字符串(信用卡号)的移动友好输入

                  相关文章

                  最新文章

                  <tfoot id='w5fnW'></tfoot>
                    <bdo id='w5fnW'></bdo><ul id='w5fnW'></ul>

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

                      <small id='w5fnW'></small><noframes id='w5fnW'>