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 2 of 2
  1. #1
    cmc
    cmc is offline
    New to the CF scene
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    <input type="button"

    Anyone know a way to get an <input type="button" onClicl='...'> to behave like a submit button in that you can use the Enter key to simulate a mouse click. With a button you have to tab to highlight it then press enter.

  • #2
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    That's how a submit button works too. If you press enter within a form element other that the submit button, the submit method of the form element is envoked. When you click on the submit button the same thing happens.

    The submit button is just a button that tells the form to submit.
    Forget style. Code to semantics. Seperate style from structure, and structure from behaviour.
    I code to specs, and test only in Firefox (unless stated otherwise).


  •  

    Posting Permissions

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