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 March 12th, 2004, 02:06 PM
Registered User
 
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default posting a textarea with a keyboard enter

Is there any way to 'save' a textarea by hitting enter on the keyboard (rather than just putting in a line break)?

Thanks

 
Old March 12th, 2004, 02:11 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

What do you mean by 'save'.

--

Joe
 
Old March 12th, 2004, 02:14 PM
Registered User
 
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I mean submit a form that is just a textarea hitting enter on the keyboard instead of clicking a submit button.

Thanks

 
Old March 12th, 2004, 02:33 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Try this link
http://msdn.microsoft.com/library/de...onkeypress.asp

If the event.keyCode equals 13 then call the submit method on the form.

--

Joe
 
Old March 12th, 2004, 06:01 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Code:
<form id=form1 action="handler.php" method=post><textarea onkeypress="if(event.keyCode==13)document.forms.form1.submit();"></textarea></form>
HTH,

----------
---Snib---
----------





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
Textarea form posting Apocolypse2005 HTML Code Clinic 2 April 20th, 2007 03:59 PM
How to disable ALT+ENTER keyboard shortcut q2q2 BOOK: Access 2003 VBA Programmer's Reference 0 November 8th, 2006 05:05 PM
Entering a password, then "enter" from keyboard? natalie09 Javascript How-To 2 April 22nd, 2004 02:56 PM





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