www.webdeveloper.com
Results 1 to 2 of 2

Thread: Press enter to click a button

  1. #1
    Join Date
    Dec 2002
    Posts
    1

    Press enter to click a button

    How do I select a button by pressing the Enter key? I am creating a login web page and want the user to be able to enter their name and password and then press the Enter key to perform the login.

    Thanks for any help you can provide.

    Zak

  2. #2
    Join Date
    Nov 2002
    Location
    England
    Posts
    275
    Most browsers do that for you, without any extra code:

    Code:
    <form action="login.php" method="post"><p>
      User name: <input name="username" />
      Pass-word: <input name="password" type="password" />
      <input type="sumbit" />
    </p></form>
    If you press enter in the text-box it should submit.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles