是否可以将HTML文本输入字段设置为密码字段?

时间:2022-11-13 19:13:51

I've got a form with a textbox on it. I have had to apply an input mask on the field as per client's requirements. Client now wants to obscure the input in the manner of a password input field. I've tried setting it as password input but the mask stops working, Is this possible or should I give up now?

我有一个表格,上面有一个文本框。根据客户的要求,我必须在字段上应用输入掩码。客户端现在希望以密码输入字段的方式来模糊输入。我试过把它设置为密码输入,但是这个面具停止工作了,这是可能的还是我现在应该放弃?

1 个解决方案

#1


3  

I found this: https://css-tricks.com/snippets/css/password-input-bullet-alternatives/

我发现这:https://css-tricks.com/snippets/css/password-input-bullet-alternatives/

Which leads to this example: http://jsfiddle.net/estelle/8WpNg/ using the -webkit-text-security property

这就导致了这个示例:http://jsfiddle.net/estelle/8WpNg/使用-webkit-text-security属性?

Seems to work in Chrome, but not Firefox. Searching a bit further I found this article that seems to discuss a JavaScript solution to making this degrade gracefully across browsers that do not support this feature with CSS: Degrading -webkit-text-security

似乎是在Chrome中工作,而不是Firefox。我进一步搜索了这篇文章,这篇文章似乎讨论了一个JavaScript解决方案,它可以在不支持CSS功能的浏览器中优雅地降低这一特性:降低webkit-文本安全性。

#1


3  

I found this: https://css-tricks.com/snippets/css/password-input-bullet-alternatives/

我发现这:https://css-tricks.com/snippets/css/password-input-bullet-alternatives/

Which leads to this example: http://jsfiddle.net/estelle/8WpNg/ using the -webkit-text-security property

这就导致了这个示例:http://jsfiddle.net/estelle/8WpNg/使用-webkit-text-security属性?

Seems to work in Chrome, but not Firefox. Searching a bit further I found this article that seems to discuss a JavaScript solution to making this degrade gracefully across browsers that do not support this feature with CSS: Degrading -webkit-text-security

似乎是在Chrome中工作,而不是Firefox。我进一步搜索了这篇文章,这篇文章似乎讨论了一个JavaScript解决方案,它可以在不支持CSS功能的浏览器中优雅地降低这一特性:降低webkit-文本安全性。