HTML and Javascript: using custom text input for password input

I want to reinvent the HTML input password.

Ok, here's the job I did:

http://www.symplik.com/password.html (This is just plain html code, nothing fancy:>)

The "password" is really text input and I used the onkeyup event to overwrite the input to mask characters.

There are two problems: (1) the reverse or deletion cannot be detected (2) if I type very quickly, some characters cannot be captured in no time.

For problem (1). it is partially solved by checking the length of the text in the password field and the stored password. This is not a very elegant solution anyway.

For problem (2) I tried to insert some time delay function between them, but still failed. I would make a readOnly field after each keyUp, but it still behaves the same.

0


a source to share


1 answer


Why not use

<input type='password'>



It masks the input for you. No javascript needed .

+7


a source







All Articles