PDA

View Full Version : clearing the value in input


Antoniohawk
10-05-2002, 11:01 PM
I have a script that clears the value of an input box onFocus. The only problem is that the value of "Password" in the password input box appears as "********". I was wondering if it was possible to make it so that it says Password, but when some1 types into it, it appears as ********. Thx in advance for helping me.

joh6nn
10-05-2002, 11:41 PM
your options are to set up a second, normal text box over the original, and make it disappear on focus, and give focus to the password box, or to set up a second, hidden input field, capture the key presses on the first input box, hold the actual value that's being entered in the hidden input field, and return the right number of asterisks to the first input.

so, it is possible, but i think that's more work than it's worth. i'd say just leave the thing alone.

whammy
10-06-2002, 04:55 AM
I second the "leave the thing alone" idea. Why don't you just have "Password:" followed by the input field on the page so people know what the field is, and it's completely cross-browser compatible?

I actually had to change a text input to a password input to make both fields align correctly in IE 6 (since apparently they introduced another bug... sigh) - and they still aligned correctly in EVERY OTHER browser, including the newest netscape and opera browsers!... but I figure if people know their username, then a few *** aren't going to hurt anything...