Watermark on Password text input using GWT

浪子不回头ぞ 提交于 2019-12-13 06:46:49

问题


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?)


回答1:


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.



来源:https://stackoverflow.com/questions/10167116/watermark-on-password-text-input-using-gwt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!