4

I am having specific requirement to display Numeric symbol keyboard in both iPhone and Android mobile devices on focus of text input field due to most of the value entered by user in the field is numeric and symbols only. But the input field can accept alphabet characters also. To improve user experience, I need to display numeric symbol keyboard as default one on field focus. But With the HTML5 input tags, i can't able to achieve this in both iPhone but and android.

Input type = text--> Alpha numeric keyboard in both iOS and Android
Input type = tel and Input type = text with pattern as 0-9 --> Number dialer keypad in both iOS and Android
Input type = number --> Numeric symbol keyboard in iOS, Numeric Keypad in android.

As per W3 standard, input type=number will accept only numeric value along with decimal separator. even if we can able to enter other symbols, invalid number will be send in form submit. So, Input type= number is not proper option for this requirement.

enter image description here

I want to display second keyboard displayed in the image as default one on focus of input field. As I am targeting for both webpage and thick application, custom keyboard is not feasible solution. Is anyone having suggestion to achieve this???

1 Answer 1

3

You can't force a specific layout in Android. You can tell the keyboard the type, such as numeric (there's several type of numerics in Android, but html isn't that rich). The keyboard, which is a separate app, then decides what keyboard to show. Based on what that particular keyboard thinks is best it may show a 9-pad, a single number row, or even ignore your request. But there is no way to force a specific design, and no way to assure your keyboard even supports that design.

Also, for something like this a custom keyboard wouldn't be a good answer even if it was feasible. Users don't like the keyboard being changed, if you do it you better have a good reason. The reason "well I like this layout better for numerics" is not a good reason. In that case you need to drop that requirement.

1
  • 1
    Thanks for your details on this. This requirement is came for increasing user experience as 90% of values being entered into the field is only numbers and special characters. Due to this, instead of displaying alphabet keyboard as default, we are trying to display number with symbol keyboard as default one. The main problem we are facing this to achieve with hybrid application.
    – Srini
    Jun 22, 2015 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.