can I change password char, in password-box in HTML. I want to change it to ■
3 Answers
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.
-
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.– AlbireoCommented 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
-
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.
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>