Automatic open numeric keypad

Is there an option to open the numeric keypad on the mobile device automatic when I select a integer field?
2 answers

I don't know that you can achieve this directly form the input widget.

I believe you can accomplish this with the UX Manipulator widget in the app store. Based on my research, the input tag needs an attribute set to identify it as a number, so the end result should be something like:

<input type="number">

From the configuration documentation of this widget:

  • Elements to search for. Put a dojo.query string here so that the widget know which elements it should manipulate. Example: ".myclass input"
  • Attribute to manipulate. This is for the attribute that the widget should change. For example "onclick".
  • String value or javascript function. For example: ""

Based on this, you could do the following:

  • Set a CSS class on your input to "myclass"
  • In the widget settings:
    • Elements to search for: ".myclass input". This will search for the input that has the myclass as part of it's class attribute
    • Attribute to manipulate: "type"
    • String value or javascript function: "number"

The input widget is of type text. In order to get the numeric keyboard on mobile devices, you need to use <input type="number"> as stated by Eric.

We investigated this option thoroughly as we wanted to implement this in the platform. Like Andrej said, we encountered quite a few missing options and inconsistent browser support.

One of the problems is that some mobile browsers assume the input language is the one of the operating system while the client assumes input is in the locale of the logged in user. These are not necessarily the same. This causes a problem while parsing decimal and thousand separators.

Another issue is that we have no control over how to display the number, meaning formatting won't work either.

I won't bore you with other things we found, but take into account that if you use or create a custom widget to input and display numeric values that there are some limitations or inconsistencies across devices and platforms.