Android的HTML5输入类型="密码"和数字键盘 [英] Android html5 input type="password" and numeric keyboard

查看:190
本文介绍了Android的HTML5输入类型="密码"和数字键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我负责造型的网页为Android和iOS,在这里你应该输入你的信用卡信息。

I am tasked with styling a web page for Android and iOS, where you are supposed to input your credit card information.

我不能得到安全code字段在Android开放的数字键盘。

I can't get the security code field to open a numerical keyboard in Android.

这是我来最接近。它适用于iOS的,但不是机器人。

This is the closest that I've come. It works on iOS, but not Android.

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

我是相当有限的什么,我允许做:

I am quite limited in what I am allowed to do:

  • 在没有Javascript中,只有HTML和CSS的修改。
  • 输入类型必须是密码

是否有可能得到一个密码输入框在Android开放了数字键盘?

Is it possible to get a password input field to open up a numerical keyboard in Android?

推荐答案

不幸的是,看起来,这是不可能做到这一点纯粹是HTML和CSS。

Unfortunately it seems that it's impossible to do this purely in html and css.

不过,对于WebKit的浏览器,你可以使用文本安全属性:

However for webkit browsers you can use text-security attribute:

input[type=number] {
    -webkit-text-security: disc;
}

,然后只用一个号码类型(是的,我读过,你不能用这个):

And then just use a number type (yes i've read that you can't use this):

<input type="number" pattern="[0-9]*">

这篇关于Android的HTML5输入类型=&QUOT;密码&QUOT;和数字键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆