使用GWT在密码文本输入上加水印 [英] Watermark on Password text input using GWT
问题描述
通过使用jQuery或动态更改,已在此处为C#解决输入类型。 jQuery选项可能在GWT中过度使用,我认为输入类型的改变是不可能的。使用GWT做最好的方法是什么?
是否真的有必要做两个输入(一个用于TextInput的水印和另一个用于密码的密码并在它们之间切换?)
最简单的是设置元素的占位符: passwd.getElement()。setProperty(watermark)
。否则,请使用位于输入顶部的标签/跨度,并在字段变得焦点/模糊时显示/隐藏。
This has been addressed for C# in here by using jQuery or by changing dynamically the "input" type. The jQuery option is probably overkilling in GWT and the change of input type I think is not possible. What is the best way to do it using GWT?
is it really necessary to do two inputs (one for the watermark as TextInput and another one for the password as Password and switch between them?)
The easiest is to set the element's placeholder: passwd.getElement().setProperty("watermark")
. Otherwise, use a label/span that you position on top of the input and show/hide as the field gets focused/blurred.
这篇关于使用GWT在密码文本输入上加水印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!