开发者

Unmask a PasswordTextBox?

开发者 https://www.devze.com 2023-03-16 15:40 出处:网络
Is it somehow possible to unmask a PasswordTextBox? I would like to have a textbox to enter a password and a checkbox, which says 开发者_运维问答Show Password. If the user clicks the checkbox, the con

Is it somehow possible to unmask a PasswordTextBox? I would like to have a textbox to enter a password and a checkbox, which says 开发者_运维问答Show Password. If the user clicks the checkbox, the content of the Passwordcheckbox becomes unmasked. I could build a custom component using TextBox but it somehow seems the wrong path.


This is how you can do it, on selecting the checkbox do -

passwordBox.getElement().setAttribute("type", "text");

Set it back to password when u want to undo it.


Try this:

passwdTextBox.getElement().setAttribute("type", "text");

This changes the type of input element from "password" to "text".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号