Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unmask a PasswordTextBox?

Tags:

gwt

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.

like image 995
helpermethod Avatar asked Dec 04 '25 21:12

helpermethod


2 Answers

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.

like image 101
Jai Avatar answered Dec 06 '25 23:12

Jai


Try this:

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

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

like image 37
Peter Knego Avatar answered Dec 06 '25 22:12

Peter Knego



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!