Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Apr 2003
    Location
    Atlanta, GA
    Posts
    487
    Thanks
    0
    Thanked 0 Times in 0 Posts

    keyCodes: case & numpad issues

    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.)

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    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

  • #3
    Regular Coder
    Join Date
    Apr 2003
    Location
    Atlanta, GA
    Posts
    487
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Check this out:
    http://www.w3.org/2002/09/tests/keys.html

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

    watch the differences fly!

  • #4
    New Coder
    Join Date
    Aug 2003
    Location
    Singapore
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Whoa! Cool!

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •