Textfield to pop out a keyboard which contains the phone keypad/numbers only

◇◆丶佛笑我妖孽 提交于 2019-12-25 05:08:43

问题


I have created a textfield as follows;

{
  xtype:'textfield',
  name:'telephone',
  label:'Telephone'
}

Instead of popping up the default keyboard which has characters and numbers. I need the keyboard to only display the phone keypad (Only numbers). Since the textfield is about getting the phone number of the user, there's no point displaying a keyboard with characters.


回答1:


You might want to try using numberfield instead.




回答2:


Using property component of textfield:

{
  xtype:'textfield',
  component: {
    xtype: 'input',
    type: 'tel'
  },
  name:'telephone',
  label:'Telephone'
}

You also have other standard input types: email, search, date... see http://www.w3schools.com/html/html5_form_input_types.asp




回答3:


This work for me in HTML5.

<input type="tel" height=30px width=200px></input>



回答4:


<input type="number"/>

This works for me in Android




回答5:


Extend Ext.ActionSheet and add button 0-9 as item in it and call show() method on focus of textfield and on buttons tap event concat value of textfield.

I use this method it may help you.



来源:https://stackoverflow.com/questions/10481560/textfield-to-pop-out-a-keyboard-which-contains-the-phone-keypad-numbers-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!