School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,419 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,495 people online right now. Registration is fast and FREE... Join Now!




A question about HTML forms

 

A question about HTML forms

SixOfEleven

21 Jun, 2009 - 05:21 PM
Post #1

Code Guru
Group Icon

Joined: 18 Oct, 2008
Posts: 2,910



Thanked: 165 times
Dream Kudos: 725
Expert In: C, C#, XNA, Game Programming, Programming Concepts

My Contributions
I'm trying to create a contact form. I've got the form working. It validates the fields and everything. I have one field, a comment section. I want the user to be able to press the enter key in it. Right now when I press the enter key in it the submit button is activated. Is there a way around this?

User is offlineProfile CardPM
+Quote Post


ericr2427

RE: A Question About HTML Forms

21 Jun, 2009 - 05:45 PM
Post #2

D.I.C Regular
Group Icon

Joined: 1 Dec, 2008
Posts: 292



Thanked: 20 times
Dream Kudos: 150
My Contributions
Replace the submit button with this.
CODE

<input type="button" value="Submit" onclick="this.form.submit()"/>

User is offlineProfile CardPM
+Quote Post

SixOfEleven

RE: A Question About HTML Forms

21 Jun, 2009 - 05:59 PM
Post #3

Code Guru
Group Icon

Joined: 18 Oct, 2008
Posts: 2,910



Thanked: 165 times
Dream Kudos: 725
Expert In: C, C#, XNA, Game Programming, Programming Concepts

My Contributions
Thanks, does exactly what I needed it to do.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 11:51PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month