Page 1 of 1

using css/javascript to hide input

Posted: Thu Apr 09, 2009 1:06 am
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?

Re: using css/javascript to hide input

Posted: Thu Apr 09, 2009 1:13 am
by JAB Creations
Are you using...

<input type="hidden" /> ?

Saving passwords always has to do with fields associated with type="password".

Re: using css/javascript to hide input

Posted: Thu Apr 09, 2009 1:23 am
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

Re: using css/javascript to hide input

Posted: Thu Apr 09, 2009 1:26 am
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.

Re: using css/javascript to hide input

Posted: Fri Apr 10, 2009 4:19 pm
by s.dot
Thanks, I will give this a try tonight and let you know how it goes.
I was unaware of this attribute.