[thelist] [code review] Caps Lock Detection

Steve Lewis nepolon at worlddomination.net
Fri Aug 8 13:19:57 CDT 2003

Joshua Olson wrote:

>Hi JS/DOM gurus,
>I have some code that detects caps lock when filling in a form.  This may be
>helpful in avoiding telephone calls when someone cannot log in because they
>have inadvertently typed in the PW in CALL CAPS.
Just a thought, but how about testing (field.value.toUpperCase() == 
field.value) from inside validate(form).  This would provide feedback 
only if the entire password was typed with the caps lock on (which is 
more likely what you are really trying to test).  You might also write a 
check into the server-side password check that toggles the case of all 
alpha characters in the pw and possibly allow that password as legal 
(just in case the user has caps lock on and uses mixed case in their 
true password).

Personally, alot of times I use upper case characters in passwords when 
I know that case is significant and this warning would seeminly 
discourage this, which locks out 35 characters from the set of 
characters users will use in their passwords just to avoid your warning 


More information about the thelist mailing list