I have a form where I need the user to enter some secret data, much like a password. I would like this data to be obscured when entered, the same as we see when we enter passwords.
Is this possible?
I have a form where I need the user to enter some secret data, much like a password. I would like this data to be obscured when entered, the same as we see when we enter passwords.
Is this possible?
You can change the type of the textbox manually to password with setAttribute
on the dom node of the textbox:
I’m not sure why password is not already an option for the type of the textbox since it is valid on input elements. That’s worth a feature request.
Why not just check the hide_text
on the textbox?
The benefit to making it type password is that you can see that some text is being entered and how many characters because it shows you the little password dots.
Yes but hide_text
does the same job, doesn’t it? Which you are doing using js.
Your clone edited with hide_text
Huh, neat. I honestly have never seen that property before, but that does indeed do the job. I figured it would entirely obscure the user from seeing that typing was going on – like when you type passwords into the Linux terminal – but that’s not the case, haha.
I do question, though, why they made this a whole nother attribute rather than just adding type password to the text box – it does the same HTML work but IMHO another type would be clearer.
Thank you all for such a lively discussion! Go figure, hiding in plane site: Hide Text.
Happy Holidays.
Dave