View Full Version : focussing a button on the return key

08-25-2006, 05:12 PM
Maybe the title isn't too clear!

What I would like to do is submit a form by using the return key - i.e. I have a form with a button which has an onClick event handler and I would like the return button to trigger the onClick event for this specific button as well. This would give the operator the choice of clicking on the button or simply using the return key on the keyboard.

Is it possible?

08-25-2006, 05:27 PM
I don't understand clearly
So, You want press some key in the keyboard instead click button ??

If I think clearly, this is code:

<input id="myButton" type="button" value="Click me" onClick="fa()" accesskey="a">

when you press on the keyboard: Atl + a
The even onclick in button will fire

08-28-2006, 03:19 PM
yes, that's exactly what I want to do - only not with the 'A' key but with the normal return key (without alt or control being needed)