简体   繁体   中英

html 5 input type for alphanumeric on mobile keyboard

We have seen when input type "Text" selected on mobile keyboard it comes up with text, when input type "number" selected on mobile keyboard it comes up with numbers only. And when input type password fields are selected then it comes up with both alphabet and numbers. Is there any way to show both alphabet and numbers on keyboard when input field are not password, rather plain text??

像这样

Hope you got my query. Thanks.

Please see this example for different kinds of keyboard inputs on mobile devices.

The keyboard that is closest to your wishes is probably the 'password' keyboard:

<input type="password">

Try:

<input type="password" pattern="[0-9]*" inputmode="numeric"> 

Before html5.1 via css:

 input[type=number] {
    -webkit-text-security: disc;
}
*<form>
  <input type="number" pattern="[0-9]*" inputmode="numeric">
  <button type="submit">Submit</button>
</form>*

this should work too putting the type as number

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM