Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 22nd, 2004, 01:36 PM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Entering a password, then "enter" from keyboard?

Im a code novice. Please help.

I've created a web page that requires a password entry.

I would like to be able to hit "enter" on the keyboard after you enter the password, as well as, having the option of to enter the password and click on a go button.

At the moment I can enter the "password" and click the "go button" and it goes to the correct page.

My question is, what is the code to enter a password and then use the "enter" button from the keyboard. And where do I place this code within the exisiting code?

Thanks so much for any help.

Natalie
 
Old April 22nd, 2004, 01:39 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

You need to use a form. Pressing enter or return when focused on a form element submits the form, triggering the onsubmit event, if there is one, and the action attribute, if there is one. Change your button to type=submit. Change the form's onsubmit to the name of the function you're calling when you press the button.

HTH,

Snib

<><
 
Old April 22nd, 2004, 02:56 PM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Snib,

Thanks so much for such a quick response.

Will try your suggestion as soon as I get home.

Best to you.

Natalie







Similar Threads
Thread Thread Starter Forum Replies Last Post
Avoid enter data from keyboard into combobox mona_upm84 Excel VBA 1 September 5th, 2008 01:26 AM
How to disable ALT+ENTER keyboard shortcut q2q2 BOOK: Access 2003 VBA Programmer's Reference 0 November 8th, 2006 05:05 PM
posting a textarea with a keyboard enter md0004 Javascript How-To 4 March 12th, 2004 06:01 PM
password for enter in access giulio_santorini Access 1 August 21st, 2003 11:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.