Solved

Form submitting and the enter key

Posted on 1998-06-27
7
175 Views
Last Modified: 2010-04-09
I was just wondering why sometimes when  you hit enter on a form, it submits it, and other times it doesn't (plays an error sound or something like that).  Also if something in the form causes this, is it the same on all the browsers, or are there different behaviors for the different browsers as well (and what are they).
0
Comment
Question by:jbirk
7 Comments
 
LVL 28

Expert Comment

by:sybe
Comment Utility
The enter key submits the form when there is only one textfield (and a submit button), in other cases it plays the error sound.


0
 
LVL 8

Author Comment

by:jbirk
Comment Utility
That's not right...  focus on the text field on this page which says "increase points to:"
Then hit enter.  On Netscape 3 and 4, it submits the form, and there are 4 fields for this form.

On IE 4, it also submits on the text field AND the checkbox field (below) when hitting enter (after focusing on those fields).
0
 
LVL 6

Expert Comment

by:alamo
Comment Utility
sybe had it right, sort of. Netscape blocks Enter as Submit if there if multiple *text* fields.What matters to Netscape on the page you mention is there is only one text field - none of the other fields are <input type=text> fields. (The comment area is a textarea).

There is no official "standard" on this, it is purely up to the browser designer. Other browsers like IE do it a little differently, as you observed. I think the general idea is to make it easier for people to submit yet to keep them from accidentally submitting before they are done filling out the form.

I wouldn't be surprised if some beta tester back in the pre-Netscape days of Mosaic had submitted feedback that led to this feature, and it has lived on, being tweaked periodically by browser designers trying to make it more useful.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 8

Author Comment

by:jbirk
Comment Utility
Thank you Alamo.  Answer the question, and I'll give you the points.
0
 
LVL 2

Expert Comment

by:ndnet
Comment Utility
The error sounds on IE4 on NT. Not on 95/98. No matter what the form is.

As for Netscape, Alamo is right.
0
 
LVL 8

Author Comment

by:jbirk
Comment Utility
I had intended for alamo to get the points (few though they may be).  Besides, what I wanted was info about when hitting enter works, not when it makes an error sound.  Alamo answered that for me.

Please answer the question alamo.
0
 
LVL 6

Accepted Solution

by:
alamo earned 10 total points
Comment Utility
Thanks, jbirk!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now