If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > window.event.keyCode return different results

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-02-05, 07:24
marconi8 marconi8 is offline
Registered User
 
Join Date: May 2003
Posts: 50
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 07:52.
Reply With Quote
  #2 (permalink)  
Old 03-02-05, 16:58
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On