When the user click HTML button, it will launch doSomething(). But I
want the user enter ENTER key, it will have same effect.
Please advise. Thanks!
> <input type="button" onClick="doSomething()">
>
> When the user click HTML button, it will launch doSomething(). But I
> want the user enter ENTER key, it will have same effect.
If the button has focus, pressing enter will invoke an onclick event. If
some other control (in a form) has focus, the form's submit button will
receive the event.
As I see it, if you do want to invoke an event on an arbitrary control,
you'll have to handle the onkeydown event on *every* control that might be
active when Enter is pressed and fire the event yourself. That's a lot of
work.
Mike
--
Michael Winter
M.Wi...@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)