Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Posts
    50

    Unanswered: window.event.keyCode return different results

    example code

    <input name="text" value="" onkeypress="inputValidation()">
    <script type="text/vbscript">
    Sub inputValidation
    With window.event
    msgbox .keyCode
    End With
    End Sub
    </script>

    when i press key "0" then msgbox = 48
    when i press key "0" on the internet part of keyboard, then msgbox = 48

    ----------------------------------------------------------------
    <input name="text" value="" onkeydown="inputValidation()">
    <script type="text/vbscript">
    Sub inputValidation
    With window.event
    msgbox .keyCode
    End With
    End Sub
    </script>

    when i press key "0" then msgbox = 48
    when i press key "0" on the internet part of keyboard, then msgbox = 96

    why it is ? , why when i use onkeydown or onkeypress i get different keyCodes ?
    Last edited by marconi8; 03-02-05 at 08:52.

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    Not sure why it is doing this but have you tried seeing what onkeyup returns??

    I suspect it is something about how the "internet" part of the keyboard is setup up. What do you mean my Internet part anyway?

Posting Permissions

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