Hi I am writing a web app (mainly iphone targeted) where the user has to enter their dob as part of the log in, I need this to be <input type = 'password'however I also want to enable the numeric section of the keyboard. I would usually change the type attr to 'number' however as this needs to be hidden I wondered if there was another way to activate the numeric pad
Cheers!
(ps I do not want to use any frameworks such as jquery on this)
I know this will probably not help the original poster (as I'm using my super necroposting powers) but here's how I've dealt with the problem (creating a field which has both password masking AND calls the numeric keyboard), for future generations' sake:
The answer is very simple:
First of all, fetch yourself a masking font (one that displays all characters as "●").
Create yourself a CSS font-face which uses that font.
Create an input with the "tel" type () and apply the font-face to it.
So basically, it is not really a password field, but a regular input field using a font that displays all characters as "●".
I have no idea if that still works and if it's true for password fields, but try naming your field "birthday_zip", or something similar, and see if it works.
发布评论
评论(3)
我知道这可能对原始海报没有帮助(因为我正在使用我的超级死灵发布能力),但这是我处理问题的方法(创建一个既具有密码屏蔽又调用数字键盘的字段),供后代使用' 原因:
答案很简单:
首先,为自己获取一种遮蔽字体(将所有字符显示为“●”的字体)。
为自己创建一个使用该字体的 CSS 字体。
使用“tel”类型 () 创建一个输入,并向其应用字体。
所以基本上,它并不是真正的密码字段,而是使用将所有字符显示为“●”的字体的常规输入字段。
这是一个可用的字体:
http://www.director-online.com/dougwiki /index.php?title=Password_Font_(ttf)
干杯!
I know this will probably not help the original poster (as I'm using my super necroposting powers) but here's how I've dealt with the problem (creating a field which has both password masking AND calls the numeric keyboard), for future generations' sake:
The answer is very simple:
First of all, fetch yourself a masking font (one that displays all characters as "●").
Create yourself a CSS font-face which uses that font.
Create an input with the "tel" type () and apply the font-face to it.
So basically, it is not really a password field, but a regular input field using a font that displays all characters as "●".
Here's a usable font for that matter:
http://www.director-online.com/dougwiki/index.php?title=Password_Font_(ttf)
Cheers!
键盘类型根据输入类型触发。目前没有其他方法可以强制使用键盘类型。
The keyboard type is fired based on the input type. There's currently no other way to force the keyboard type to use.
这更有意义:-)
我找到了一篇(较旧的)文章,其中 iPhone 使用数字键盘,如果元素的名称包含:
zip
或phone< /code>:
http:// /www.bennadel.com/blog/1197-Defaulting-To-The-Numeric-Keyboard-On-The-iPhone.htm
我不知道这是否仍然有效以及密码字段是否正确,但请尝试将您的字段命名为
“birthday_zip”
或类似的名称,然后看看它是否有效。That makes much more sense :-)
I've found an (older) article an this, where the iPhone uses the numeric keyboard, if the name of the element contains:
zip
orphone
:http://www.bennadel.com/blog/1197-Defaulting-To-The-Numeric-Keyboard-On-The-iPhone.htm
I have no idea if that still works and if it's true for password fields, but try naming your field
"birthday_zip"
, or something similar, and see if it works.