i have a login form

(source: deviantart.net)
what i want is that after i have filled the password field when i press “Enter”, it performs some action, some set of lines of code, in my case the same that the “Login button does”. how to do it
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Add an eventhandler for keypress on the password textbox, in that eventhandler you check for the enter key, and call the (eventhandler) method that the login button is bound to.