使用GWT在密码文本输入上加水印 [英] Watermark on Password text input using GWT

查看:158
本文介绍了使用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屋!

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