views:

448

answers:

3

As the title says: is there any way to change the "*" or in some browsers a bullet that appears in password fields in HTML?

thx

+3  A: 

You can't change the password masking character in the standard password field. You can fake it with a textbox, but it makes for a weak security model because you don't get the protection you do from the password textbox. As a side note, it's generally not a good idea to change the behaviour of items like this because users have become used to one form of masking, and you will be introducing a different one - if there's no good reason to do this, I'd avoid it.

This script shows you how to do this, but I'd recommend against doing this.

Pete OHanlon
A: 

"*" is called Asterisk btw

A-R
A: 

No - the user agent chooses its own default style, and there is (to my knowledge) no CSS attributes you can change to determine the masking character.

Of course, this would be possible if the password field was just a standard text field, and you manually masked the input with a javascript event handler (onKeyPress, probably). You could even declare the field as type="password" in the HTML, then have your JS function modify the DOM to change its type. I'd be a little wary about doing this, though; the browser implementation is almost certainly pretty solid, and circumventing established security functionality to roll your own is rarely a good idea.

Andrzej Doyle
Established security functionality? Password and text input fields in HTML are about the same, just the UI changes, with the masking happening in password fields.I'm not downvoting your answer, but this is not like reinventing the wheel or creating a homebrew crypto engine, it's just patching a UI element to your meet your likes.
Spidey