问题
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