pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

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

    1. <tfoot id='ezKIY'></tfoot>

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

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

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

      1. 數字+空格字符串(信用卡號)的移動友好輸入

        Mobile-friendly input of a digits + spaces string (a credit card number)(數字+空格字符串(信用卡號)的移動友好輸入)

          <bdo id='t1CET'></bdo><ul id='t1CET'></ul>
            <tbody id='t1CET'></tbody>
          <tfoot id='t1CET'></tfoot>

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

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

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

                • 本文介紹了數字+空格字符串(信用卡號)的移動友好輸入的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個信用卡號輸入表單,移動瀏覽器和非移動瀏覽器都將使用它.

                  我想暗示一個鍵盤應該出現在移動設備上,并允許(可選)空格,所以應該接受4111 1234 1234 1234"或4111123412341234".

                  根據我的發現,選項是:

                  a) <input type="tel"/> - 這似乎符合我的要求(至少在當前的移動瀏覽器中),但它在語義上是錯誤的.

                  b) <input type="text" pattern="[d ]*"/> 或類似的 - iPhone 可以識別一些模式 ([0-9]*, d*)與使用鍵盤一樣,但這在 Android 上效果不佳.此外,我不確定 iPhone 是否會提供任何允許空格的小鍵盤模式,盡管我現在手頭沒有 iPhone 可以檢查.

                  c) 嘗試使用 Javascript 進行瀏覽器檢測并使用 (a) 用于移動設備和 (b) 用于非移動設備.雜亂無章,對 (a) 沒有真正的好處.

                  <input type="number"/> 似乎是一個非首發,因為 Chrome 至少會將此類輸入強制為數字,因此會使用空格中斷輸入.

                  有沒有比使用 type="tel" 更好的方法來提示移動瀏覽器應該提供數字鍵盤?

                  也許是一個 -webkit-* 屬性,可以應用于普通文本輸入字段以提示應該顯示小鍵盤?

                  解決方案

                  對于仍然可以包含空格和其他特殊字符的文本字段,語義正確的標記是 但是據我所知,inputmodework/multipage/association-of-controls-and-forms.html#attr-fe-inputmode" rel="noreferrer">WhatWG 目前尚不支持任何瀏覽器.其目的是在具有數字小鍵盤但仍充當文本輸入的設備上為用戶提供數字小鍵盤.

                  我的建議是用 JS 填充 inputmode 并在觸摸設備上更改為 type="tel" (這是目前可用的最佳解決方案).請注意,不同的設備具有非常不同的電話"和數字"鍵盤,iOS 的電話"不允許使用空格,而 Chrome 移動版允許使用各種特殊字符.誰知道自定義 Android 鍵盤有什么作用?

                  如果你不想構建自己的 polyfill,你可以實現 Webshim 現在polyfills inputmode 從 release 1.14.0.這也有一個很好的特性,可以通過設置 pattern="[0-9]*" 如果你想要它來保持調用 iOS數字"鍵盤(注意:這不是你得到的同一個鍵盤當設置 type="number"!)

                  這是我對跨瀏覽器的輸入類型行為和我的分析與@aFarkas(Webshim 作者)就 polyfill 輸入模式進行辯論.p>

                  I have a credit card number input form that will be used by both mobile and non-mobile browsers.

                  I want to hint that a keypad should appear on mobile, and to allow (optional) spaces, so either "4111 1234 1234 1234" or "4111123412341234" should be accepted.

                  From what I've found, the options are:

                  a) <input type="tel"/> - this seems to behave as I want (with current mobile browsers at least), but it's semantically wrong.

                  b) <input type="text" pattern="[d ]*"/> or similar - the iPhone recognises some patterns ([0-9]*, d*) as working with the keyboard, but this doesn't work as well on Android. Also I'm not sure there are any patterns that the iPhone will give a numpad for that allow spaces, though I don't have an iPhone on hand to check right now.

                  c) Attempt browser detection with Javascript and use (a) for mobile and (b) for non-mobile. Cludgy, and no real benefit over (a).

                  <input type="number"/> seems to be a non-starter since Chrome at least will force such input to a number, therefore breaking input with spaces.

                  Is there a better way of hinting to mobile browsers that they should offer a numpad than using type="tel"?

                  Edit:

                  Maybe a -webkit-* property that could be applied to a normal text input field to hint that a numpad should be shown?

                  解決方案

                  The semantically correct markup for a text field that can still contain whitespace and other special characters is <input type="text" inputmode="numeric"/> however as far as I am aware while inputmode is recommended by WhatWG it is not yet supported by any browsers. Its intent is to present the user with a numeric keypad on a device that has it but still behave as a text input.

                  My suggestion would be to polyfill inputmode with JS and change to type="tel" on touch devices (which is the best solution currently available). Be mindful that differently devices have very different 'tel' and 'number' keypads, iOS 'tel' does not allow spaces while Chrome mobile allows all sorts of special characters. Who knows what custom Android keypads do?

                  If you don't want to build your own polyfill you can implement Webshim which now polyfills inputmode as of release 1.14.0. This also has has the nice feature of keeping the iOS 'number' keypad invoked by setting pattern="[0-9]*" if you want it (note: this is not the same keypad you get when setting type="number"!)

                  Here is the analysis I did on input type behavior across browsers and my debate with @aFarkas (the Webshim author) on polyfilling inputmode.

                  這篇關于數字+空格字符串(信用卡號)的移動友好輸入的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  Input validation with pattern Angular 2(使用模式 Angular 2 進行輸入驗證)
                  How to change the css class name dynamically in angular 2(如何在角度2中動態更改css類名)
                  How to remove default color in input type?(如何刪除輸入類型中的默認顏色?)
                  How to add click event to dynamically added html element in typescript(如何將點擊事件添加到打字稿中動態添加的html元素)
                  XPath one of multiple attribute values with condition(XPath 具有條件的多個屬性值之一)
                    <tbody id='bxwBF'></tbody>

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

                            <bdo id='bxwBF'></bdo><ul id='bxwBF'></ul>

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

                            <tfoot id='bxwBF'></tfoot>
                          • 主站蜘蛛池模板: 科昊仪器超纯水机系统-可成气相液氮罐-美菱超低温冰箱-西安昊兴生物科技有限公司 | 番茄畅听邀请码怎么输入 - Dianw8.com| 烘干设备-热泵烘干机_广东雄贵能源设备有限公司 | 苏州伊诺尔拆除公司_专业酒店厂房拆除_商场学校拆除_办公楼房屋拆除_家工装拆除拆旧 | 工控机-图像采集卡-PoE网卡-人工智能-工业主板-深圳朗锐智科 | 深圳高新投三江工业消防解决方案提供厂家_服务商_园区智慧消防_储能消防解决方案服务商_高新投三江 | 防火阀、排烟防火阀、电动防火阀产品生产销售商-德州凯亿空调设备有限公司 | 土壤有机碳消解器-石油|表层油类分析采水器-青岛溯源环保设备有限公司 | 热回收盐水机组-反应釜冷水机组-高低温冷水机组-北京蓝海神骏科技有限公司 | WF2户外三防照明配电箱-BXD8050防爆防腐配电箱-浙江沃川防爆电气有限公司 | 带式过滤机厂家_价格_型号规格参数-江西核威环保科技有限公司 | 东莞市超赞电子科技有限公司 全系列直插/贴片铝电解电容,电解电容,电容器 | 结晶点测定仪-润滑脂滴点测定仪-大连煜烁 | 济南铝方通-济南铝方通价格-济南方通厂家-山东鲁方通建材有限公司 | 云南成人高考网| 塑胶跑道_学校塑胶跑道_塑胶球场_运动场材料厂家_中国塑胶跑道十大生产厂家_混合型塑胶跑道_透气型塑胶跑道-广东绿晨体育设施有限公司 | 安徽控制器-合肥船用空调控制器-合肥家电控制器-合肥迅驰电子厂 安徽净化板_合肥岩棉板厂家_玻镁板厂家_安徽科艺美洁净科技有限公司 | 聚合氯化铝价格_聚合氯化铝厂家_pac絮凝剂-唐达净水官网 | 气胀轴|气涨轴|安全夹头|安全卡盘|伺服纠偏系统厂家-天机传动 | 废气处理_废气处理设备_工业废气处理_江苏龙泰环保设备制造有限公司 | SDG吸附剂,SDG酸气吸附剂,干式酸性气体吸收剂生产厂家,超过20年生产使用经验。 - 富莱尔环保设备公司(原名天津市武清县环保设备厂) | 查分易-成绩发送平台官网| 温州中研白癜风专科_温州治疗白癜风_温州治疗白癜风医院哪家好_温州哪里治疗白癜风 | 一体化隔油提升设备-餐饮油水分离器-餐厨垃圾处理设备-隔油池-盐城金球环保产业发展有限公司 | 无菌水质袋-NASCO食品无菌袋-Whirl-Pak无菌采样袋-深圳市慧普德贸易有限公司 | 硅胶管挤出机厂家_硅胶挤出机生产线_硅胶条挤出机_臣泽智能装备 贵州科比特-防雷公司厂家提供贵州防雷工程,防雷检测,防雷接地,防雷设备价格,防雷产品报价服务-贵州防雷检测公司 | 山东锐智科电检测仪器有限公司_超声波测厚仪,涂层测厚仪,里氏硬度计,电火花检漏仪,地下管线探测仪 | 不锈钢钢格栅板_热浸锌钢格板_镀锌钢格栅板_钢格栅盖板-格美瑞 | 数显水浴恒温振荡器-分液漏斗萃取振荡器-常州市凯航仪器有限公司 | 高速龙门架厂家_监控杆_多功能灯杆_信号灯杆_锂电池太阳能路灯-鑫世源照明 | 不锈钢钢格栅板_热浸锌钢格板_镀锌钢格栅板_钢格栅盖板-格美瑞 | 工业淬火油烟净化器,北京油烟净化器厂家,热处理油烟净化器-北京众鑫百科 | 上海租奔驰_上海租商务车_上海租车网-矢昂汽车服务公司 | 压砖机_电动螺旋压力机_粉末成型压力机_郑州华隆机械tel_0371-60121717 | 钢格板_钢格栅_格栅板_钢格栅板 - 安平县鑫拓钢格栅板厂家 | 铝箔袋,铝箔袋厂家,东莞铝箔袋,防静电铝箔袋,防静电屏蔽袋,防静电真空袋,真空袋-东莞铭晋让您的产品与众不同 | 无锡装修装潢公司,口碑好的装饰装修公司-无锡索美装饰设计工程有限公司 | 上海璟文空运首页_一级航空货运代理公司_机场快递当日达 | 工业用品一站式采购平台|南创工品汇-官网|广州南创 | 油缸定制-液压油缸厂家-无锡大鸿液压气动成套有限公司 | 钢结构厂房造价_钢结构厂房预算_轻钢结构厂房_山东三维钢结构公司 |