Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HTA Text input & enter key?

748 views
Skip to first unread message

Bob

unread,
Apr 25, 2005, 2:03:50 PM4/25/05
to
I have an HTA which accepts a username via a text input box and a seperate
"submit" button.

Is there a way I can do away with the "submit" button and have the input
text accepted with the "Carriage Return" key?

I can see all sorts of events to do with mouse over, click, dbl clk etc but
nothing that looks like on_enter.
There is an "on_key" event, so do I use that and parse for the enter key?


tlav...@hotmail.com

unread,
Apr 25, 2005, 2:57:58 PM4/25/05
to
I use something like this ...

sub checkEnter
With document.parentWindow.event
if .keycode = 13 then
callWhatYourSubmitDoesHere
Else
.cancelbubble = false
.returnvalue = true
End if
End With
End sub


with an input box like this ...

<input type=text onkeydown=checkEnter size=60 id=Cmd>

I'd leave the 'Submit' button for those who can't live without clicking
the mouse.

Tom Lavedas
=============

0 new messages