6

can I change password char, in password-box in HTML. I want to change it to ■

1
  • Webkit browsers use the bullet symbol from the set font... here are instructions on how to change the input password symbol using a custom font (webkit only).
    – Mottie
    Commented Sep 2, 2015 at 13:23

3 Answers 3

18

As far as I know, this can't be done. The password field is rendered natively by the browser.

You could probably build a JavaScript-based workaround, but that would not be as secure, break auto-completion and/or the browser's internal password management, and have other side-effects.

If at all possible, I would stick with the browser's rendering.

4
  • 7
    +1 - I've seen this attempted (never done) and it wasn't pretty Commented Nov 23, 2010 at 14:37
  • /agree with the "Stick with the standard behaviour, don't mess and break up things" way.
    – Albireo
    Commented Nov 23, 2010 at 14:38
  • +1 for "stick with the browser's rendering." You don't even need expensive usability studies to determine that users are more comfortable with native UI elements than heavily-modified, non-standard controls.
    – Cody Gray
    Commented Nov 23, 2010 at 14:53
  • @pekka is it still not possible in 2020
    – Rahul
    Commented Jun 27, 2020 at 4:34
3

That is controlled by the respective browser so as far as I know, it's not possible. You would have to come up with some out of the box solution but risking security, it's probably not worth it.

0

There is one solution availaible in javascript i have a function here

<script type="text/javascript">
   var k=0;
   var df;
window.onload=function() {
   df=document.forms[0];
df[1].onkeydown=function() {
    df[1].className='white';
 }
df[1].onkeyup=function() {
df[0].value+=df[1].value.charAt(k);
   k++;
for(c=0;c<df[1].value.length;c++) {
   df[1].value=df[1].value.replace(df[1].value.charAt(c),'#');
   df[1].className='black';
   }
  }
 }
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.