Remember that CEP is a text that is composed of numeric characters, so it does not make sense to use the number
field. As already commented, in HTML 5 there is the inputmode
attribute that can be used to assist devices that display virtual keyboards in their forms that make it easier to fill the field.
The possible values of this attribute are:
-
none
: no keyboard will be displayed;
-
text
: textual keyboard according to user location;
-
decimal
: fractional numeric keypad;
-
numeric
: numeric keypad;
-
tel
: telephone keypad - numeric including the * and # keys (it is preferable to use <input type="tel">
);
-
search
: virtual keyboard optimized for searches;
-
email
: textual keyboard for emails (it is preferable to use <input type="email">
);
-
url
: textual keyboard for URLs (it is preferable to use <input type="url">
);
You can read more in the WHATWG specification and see the current support at Can I Use .