0

I want to a number only keyboard on an input box which is used for entering pin (number password) for my app. Currently, i have only seen that type of keyboard in yahoo mail app and phonepe app which looks like this this is in yahoo app

Right now I am using input type tel, but the problem with that is the extra keys which allow the user to enter "space" and "-" sign which I need to block it by using directive and stuff

Any help Will be appreciated

P.S:: please don't say its a duplicate because I have already referenced this numeric keyboard on android the question might be same but the requirement is different.

thanks

MSD
  • 437
  • 6
  • 18
  • This is probably what you're looking for https://stackoverflow.com/a/31619311/5610030 – Shogunivar Oct 13 '17 at 14:30
  • 2
    Possible duplicate of [Phone: numeric keyboard for text input](https://stackoverflow.com/questions/6178556/phone-numeric-keyboard-for-text-input) – NineBerry Oct 13 '17 at 14:30
  • @Shogunivar .. that is what I am currently using in my application, but others are using a different keyboard, application like phonepe.. don't even display any other buttons (as shown in the pic of my question)... i want something like that – MSD Oct 14 '17 at 05:00
  • @NineBerry .. it is not a duplicate .. I don't want the numeric keyboard as it gives the option to type "space and dot" and I don't want that .. and I know I can disable them using some regex... which is what I am currently doing, but I want a keyboard like the one in the pic... some application are using it – MSD Oct 14 '17 at 05:10
  • What is the functional difference between the keyboard you get using type=number and regex and the keyboard you want? I don't see any. – NineBerry Oct 14 '17 at 10:11
  • @NineBerry the functional difference it that it still takes space (even after that regex)... and also it is an extra load every button click to chk whether the input matches the regex or not.... so performance degrades in lower-end phones – MSD Oct 16 '17 at 14:10
  • At the time, the answers were written, the result was what you did expect (as you can see from the screenshots). I suppose that the behaviour in the browsers has changed. I think that the other apps that you see using the reduced keyboard are probably native apps, not web based, that have more control over what keyboard to use. – NineBerry Oct 16 '17 at 14:21
  • @NineBerry well even the native solution will work ... I just want to know how they are using it. – MSD Oct 17 '17 at 07:41
  • They are not using HTML, but a native Android form with an `EditText` control with its `inputType` set to [`numberPassword`](https://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType) – NineBerry Oct 17 '17 at 09:06

0 Answers0