input field to default to numerical keypad

5 posts, 1 answers
  1. Answer
    Michael
    Michael avatar
    151 posts
    Member since:
    Jan 2012

    Posted 13 Jan 2014 Link to this post

    I have seen mobile websites with input fields which bring up a numerical keypad by default (say for entering quantity or banking number, etc).

    Is there a way to accomplish this with kendo?
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 15 Jan 2014 Link to this post

    Hi Michael,

    Kendo UI does not have control over the device keyboard by design. You can achieve this with the simple HTML elements like:

    <input type="text" pattern="\d*"> for iOS
    <input type="number"> for Android

    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Michael
    Michael avatar
    151 posts
    Member since:
    Jan 2012

    Posted 15 Jan 2014 Link to this post

    This: <input type="number"> worked for both devices.

    This: <input type="text" pattern="\d*"> just resulted in an empty space.
  4. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 17 Jan 2014 Link to this post

    Hello Michael,

    <input type="text" pattern="\d*"> on iOS7 device forces the number only keyboard, but does not work as expected on Android. Anyway I happy to hear that you have found the solution for your case.

    Have a happy weekend!

    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Michael
    Michael avatar
    151 posts
    Member since:
    Jan 2012

    Posted 20 Jan 2014 Link to this post

    On my iOS7 device, 'pattern="\d*"' doesn't do anything. In fact, there won't even be an input field displayed.

    <input type="number">  results in a number pad, though - on both devices.
Back to Top