Form Input : Show only number Keyboard

Limit to number keyboard for input entries of the user for phone number, Zip Code etc. For entries of fields that require only numbers, we can use the numeric keyboard. This avoids showing alphabets in the keyboard. So it will help the user to easily enter the inputs.

We can add an attribute to the <input> tag

inputmode="numeric"

or

inputmode="tel"

Example Code : Number only keyboard input field HTML

     <input
          type="text"

          inputMode="numeric"   //numeric keyboard attribute

          id="tel"
          placeholder="Your number"
        />

About the Author: smartcoder

You might like

Leave a Reply

Your email address will not be published. Required fields are marked *