By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,842 Members | 2,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,842 IT Pros & Developers. It's quick & easy.

How to submit form with <enter>?

P: n/a
I have a text area form object. A user clicks a send button and the text
area information is submitted. How can I also allow the information to be
submitted after the user hits the <enter> key?

Thanks,
Brett
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Brett" <my*******@cygen.com> writes:
I have a text area form object. A user clicks a send button and the text
area information is submitted. How can I also allow the information to be
submitted after the user hits the <enter> key?


If you do that, he can only enter one line of text. Then you can just
use an <input type="text"> instead of a text area. It automatically
submits when you press return.

If you insist on using a script:

<textarea onkeypress="if (event.keyCode == 13) {this.form.submit();}">

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

P: n/a
Brett hu kiteb:
I have a text area form object. A user clicks a send button and the
text area information is submitted. How can I also allow the
information to be submitted after the user hits the <enter> key?

usea normal text field instead of a textarea field. It should then
submit as a default action when enter is pressed.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.