|
-
Aug 20th, 2001, 03:30 AM
#1
Thread Starter
Hyperactive Member
Key Press
How can I trap which key is being pressed on a document.
I can get it to display a message when a key has been pressed, but I need to trap just certain keys using Javascript.
Help!!
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Aug 20th, 2001, 08:11 PM
#2
Fanatic Member
I'm pretty sure this is IE, not sure about Netscape...
Code:
<script LANGUAGE = "JavaScript">
function showKey(){
alert(event.keyCode);
}
document.onkeypress = showKey;
</script>
Just hit the key you want to find out the keycode...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|