0

How to open numeric keypad automatically on page load in Chrome in Android?

Tried

<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, user-scalable=no" />
<script>document.addEventListener("DOMContentLoaded", () => document.querySelector("input[inputmode='numeric']").focus())
</script>
</head>
<body>
  <form action="/Ostupult" id="js-form" method="post">
    <input type="number" />
    <input type="tel" value="" min="0" max="9999" autofocus inputmode="numeric" step=".1" />
  </form>
</body>
</html>

Second field receives focus but numeric pad does not appear. Opening it requires manually touching input field to open numeric pad for number entry.

This is extra step for user. How to eliminate this so that quantity can immediately entered from numeric pad?

Using Zebra PS20 Personal Shopper in Android.

Andrus
  • 26,339
  • 60
  • 204
  • 378
  • Try adding `inputmode="numeric"` to the second field? – Ar Rakin Mar 29 '23 at 16:22
  • I added `inputmode="numeric"` but numeric pad still does not open. It opens only if user taps into field. I updated sample in question. – Andrus Mar 29 '23 at 19:54
  • Hmm so autofocus does not work. Why not make use of some javascript then? ` – Ar Rakin Mar 30 '23 at 09:32
  • I added this line but numpad still does not open. Second field gots focus so autofocus works. However numpad is opened only if users taps in input field. How to open nupad without user interaction? – Andrus Mar 30 '23 at 18:13

0 Answers0