PDA

View Full Version : Key Code Question?


hosehead78
10-08-2003, 07:10 PM
Whats the Key code for Enter?

Im using it for a check if Enter is hit it goes to the next Text Field?


Any help ?

Thanks

Whiteknight
01-10-2004, 01:36 AM
javascript lists "enter" as being keyCode=13

double check my code:


<html>
<head>
<script type="text/javascript">
function keytest()
{
keypress=(document.all&&event.keyCode);
alert("keycode = "+keypress);
}

document.onkeypress=quicktest;
</script>
</head>
</html>


I'm not sure if VB and JS would list the same key codes, but i assume they would.

quatu
01-22-2004, 01:30 PM
JS and VB has the same key codes. Her is an example:

Private Sub TextBox1_KeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer)
If KeyCode = 13 Then
MsgBox "Pressed ENTER"
End If
End Sub