piattnd
asked on
How to make an Input field recognize the enter keystroke
I've got an HTA that has 1 input box and 8 read only return boxes. I want the 1 input box to submit the user's entry on the enter keystroke. I know the input box has to have the onKeyDown(callsub), but what does the sub do?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks much, I actually had hit up a friend who helped me understand what was going on. I appreciate the response (yours was what I was looking for)!
Hi, you can add this to you <body> tag in the HTML section:
<body onkeypress='vbs:Default_Bu ttons'>
and then add this in your <script> section:
Sub Default_Buttons
If Window.Event.KeyCode = 13 Then
btn_install.Click
End If
End Sub
where you can change btn_install.Click to the name of the OK button control.
Regards,
Rob.
<body onkeypress='vbs:Default_Bu
and then add this in your <script> section:
Sub Default_Buttons
If Window.Event.KeyCode = 13 Then
btn_install.Click
End If
End Sub
where you can change btn_install.Click to the name of the OK button control.
Regards,
Rob.
Hmm, that grade simply seems inappropriate. The answer was technically sound. So I "lost" 500pts for no reason. Perhaps you should read:
https://www.experts-exchange.com/help.jsp#hi504
https://www.experts-exchange.com/help.jsp#hi504
ASKER
My fault hielo, I gave you a B because I had already found solution prior to your posting.... :-/
ASKER
Rob,
I'll give that a shot on the next HTA I use. I was actually curious if there was a way to just "push" the button through code, which appears to be what you suggested.
I'll give that a shot on the next HTA I use. I was actually curious if there was a way to just "push" the button through code, which appears to be what you suggested.
ASKER