|
-
Jun 26th, 2001, 02:27 PM
#1
Thread Starter
Hyperactive Member
Form Keypress Event
I have a web page form that I want to validate.
How can I capture the Ascii code for the onKeyPress event of a web page textbox?
Such as (VB Code):
Code:
Private Sub txtFileNum_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End If
End Sub
Thanks in advance.
-
Jun 26th, 2001, 03:15 PM
#2
Thread Starter
Hyperactive Member
All I want to do is capture what key is being press in a textbox.
I would appreciate any help?
-
Jun 26th, 2001, 03:25 PM
#3
Does this help you?
<HEAD>
<SCRIPT>
</SCRIPT>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function text1_onkeypress() {
alert( window.event.keyCode);
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<form name=form1>
<input type=text name=text1 LANGUAGE=javascript onkeypress="return text1_onkeypress()">
</form>
</BODY>
-
Jun 26th, 2001, 03:48 PM
#4
Thread Starter
Hyperactive Member
I was hoping for VBScript but that will work.
Thank you.
-
Jun 26th, 2001, 04:08 PM
#5
Frenzied Member
Pretty much the same:
Code:
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=VBScript>
Sub text1_onkeypress
window.alert window.event.keyCode
End Sub
</SCRIPT>
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
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
|