• <legend id='MHuVu'><style id='MHuVu'><dir id='MHuVu'><q id='MHuVu'></q></dir></style></legend>

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

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

      1. 如何将文本区域限制为仅保存数字?

        How to limit the textarea to only hold numbers?(如何将文本区域限制为仅保存数字?)

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

              <tbody id='hG1zN'></tbody>

            <tfoot id='hG1zN'></tfoot>

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

                1. 本文介绍了如何将文本区域限制为仅保存数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在我的博客上创建一个日期文本框,而日期只是数字.我不希望任何人在输入字母时出错.有没有办法将字符限制为仅数字?谢谢!

                  I'm trying to make a date textbox on my blog, and the date is only numbers. I don't want anybody making a mistake typing a letter. Is there any way to limit the characters to only numerals? Thanks!

                  推荐答案

                  如果你使用 jQuery,你可以像 这个jsfiddle

                  If you use jQuery, you can do it like in this jsfiddle

                  $('input').keypress(function(e) {
                      var a = [];
                      var k = e.which;
                  
                      for (i = 48; i < 58; i++)
                          a.push(i);
                  
                      if (!(a.indexOf(k)>=0))
                          e.preventDefault();
                  });
                  

                  这篇关于如何将文本区域限制为仅保存数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to test html links with protractor?(如何用量角器测试 html 链接?)
                  protractor unknown error, removing attribute from DOM(量角器未知错误,从 DOM 中删除属性)
                  How to set HTML5 type=quot;datequot; input fields (e.g. in Chrome) using Selenium/Protractor?(如何设置 HTML5 type=date;使用 Selenium/Protractor 的输入字段(例如在 Chrome 中)?)
                  HTML form values adding commas in Classic ASP(在经典 ASP 中添加逗号的 HTML 表单值)
                  How to integrate WebSockets on top of a classic ASP web application?(如何在经典的 ASP Web 应用程序之上集成 WebSockets?)
                  ActiveX Calendar Control Not Working In Windows 7(ActiveX 日历控件在 Windows 7 中不起作用)

                      1. <tfoot id='h5Dp5'></tfoot>
                        • <bdo id='h5Dp5'></bdo><ul id='h5Dp5'></ul>

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

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

                          • <legend id='h5Dp5'><style id='h5Dp5'><dir id='h5Dp5'><q id='h5Dp5'></q></dir></style></legend>