using css/javascript to hide input

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

using css/javascript to hide input

Post by s.dot »

I have a few password fields on a site I am working that *should* be hidden from view while typing just like a password field. However, when the forms are submitted the browser wants to save this password (not the site login password) as my login password.

This is very frustrating!

So I guess I kind of need a psuedo-password input field that will be type="text" with some accompanying css/javascript to make it seem like a password field.

Is this easily accomplishable?

The only thing I can think of is using javascript to fill a hidden input field with the real value and replacing the input fields value with asterisks... which seems like a very ugly solution.

If it can be done with css.... that would be awesome.

Anybody done anything like this?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: using css/javascript to hide input

Post by JAB Creations »

Are you using...

<input type="hidden" /> ?

Saving passwords always has to do with fields associated with type="password".
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: using css/javascript to hide input

Post by s.dot »

Yeah I'm currently using input type="password", because it is a password field
it's just not a password i want people's browsers saving for site login info

think uh... "enter the senders password to begin file download" type of deal

I could always just use text but I reckon people feel safer with the asterisks
I could also use an obscure font-family

hmm
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: using css/javascript to hide input

Post by JAB Creations »

Try...

<input autocomplete="off" />

...and let me know if that helps. I think you can apply that to a form element directly for the entire form though I'm not sure offhand.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: using css/javascript to hide input

Post by s.dot »

Thanks, I will give this a try tonight and let you know how it goes.
I was unaware of this attribute.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply