Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    focussing a button on the return key

    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?

  • #2
    New Coder
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •