View Full Version : keyCodes: case & numpad issues

06-12-2003, 07:20 PM
I'm trying to use a keyUp validator to only allow numeric input (including a single dot) while still allowing tab, enter, etc. to pass through.

I've noticed (in IE6, the target browser-- intranet) that the keyCode is sometimes different (but not always) depending on whether caps lock is on, shift is held, etc. Also, there is an overlap between the numPad and the start of the lowercase alphabet's keyCodes.

Using keyDown doesn't work either.

Anybody run into this issue before? If so, how'd you deal with it?

(I searched on keyCode and didn't find an answer in the top 50 or so results.)

06-12-2003, 09:13 PM
LOL, I never noticed that with the shift key down on the number pad.

I tested it ot on my script here:
http://www10.brinkster.com/A1ien51/Scripts/KeyCode.htm and saw that sometimes it was 35 and sometimes it was the real number....lol,,,,,hmmm

06-13-2003, 05:32 PM
Check this out:

Type some letters, numbers, lowercase, uppercase, numberpad, etc.

watch the differences fly!

10-29-2003, 03:00 AM
Whoa! :thumbsup: Cool!

I was going to hit a wall when I saw the link! Thanks!