Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - why does this "bung" me

 
Thread Tools Search this Thread
Old 02-09-2004, 07:33 PM   #1
Default why does this "bung" me


In IE 6.0 if you load an HTML document that looks like the
following...

<HTML>
<body>
<form>
<input type="text" /> <input type="text" />
</form>
</body>
</HTML>


the browser makes a noise if you put the focus in one of the textboxes
and hit 'enter' (noise sounds like a dull 'bung!'). If you remove one
of the textboxes the noise doesn't occur. Can someone explain to me
why this is happening?

Thanks,
John


John Livermore
  Reply With Quote
Old 02-09-2004, 07:51 PM   #2
Augustus
 
Posts: n/a
Default Re: why does this "bung" me


"John Livermore" <> wrote in message
news:...
> In IE 6.0 if you load an HTML document that looks like the
> following...
>
> <HTML>
> <body>
> <form>
> <input type="text" /> <input type="text" />
> </form>
> </body>
> </HTML>
>
>
> the browser makes a noise if you put the focus in one of the textboxes
> and hit 'enter' (noise sounds like a dull 'bung!'). If you remove one
> of the textboxes the noise doesn't occur. Can someone explain to me
> why this is happening?


add a submit button and it will stop


  Reply With Quote
Old 02-10-2004, 12:46 AM   #3
Jukka K. Korpela
 
Posts: n/a
Default Re: why does this "bung" me

John Livermore <> wrote:

> <form>
> <input type="text" /> <input type="text" />
> </form>


Why would you do that?

> the browser makes a noise if you put the focus in one of the
> textboxes and hit 'enter' (noise sounds like a dull 'bung!').


The markup is invalid in a serious way, since there is no action
attribute, hence no defined meaning for form submission.

> If you remove one of the textboxes the noise doesn't occur. Can
> someone explain to me why this is happening?


Maybe the browser keeps submitting the form to the page itself
and autofocusing. Who knows, and who cares? Just do the right thing,
and let browsers do strange things with incorrect HTML.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


  Reply With Quote
Old 02-10-2004, 11:38 AM   #4
Eric Bohlman
 
Posts: n/a
Default Re: why does this "bung" me

"Jukka K. Korpela" <> wrote in
news:Xns948B1B966EA6jkorpelacstutfi@193.229.0.31:

> John Livermore <> wrote:
>
>> <form>
>> <input type="text" /> <input type="text" />
>> </form>

>
> Why would you do that?
>
>> the browser makes a noise if you put the focus in one of the
>> textboxes and hit 'enter' (noise sounds like a dull 'bung!').

>
> The markup is invalid in a serious way, since there is no action
> attribute, hence no defined meaning for form submission.
>
>> If you remove one of the textboxes the noise doesn't occur. Can
>> someone explain to me why this is happening?

>
> Maybe the browser keeps submitting the form to the page itself
> and autofocusing. Who knows, and who cares? Just do the right thing,
> and let browsers do strange things with incorrect HTML.


That wouldn't explain why he doesn't get the "error sound" with only one
field, and in any case I think he left off the action because he was just
trying to construct a short example, knowing full well that he'd need one
in real life.

The reason, I'm quite sure, is that when you have only one text field, or
multiple text fields with a submit button, hitting enter has a defined
result: submitting the form. But when there are multiple text fields and
no submit button, hitting enter doesn't have a defined result, and the
browser is simply alerting the user that the key he pressed has no meaning.
  Reply With Quote
Old 02-10-2004, 05:26 PM   #5
Jukka K. Korpela
 
Posts: n/a
Default Re: why does this "bung" me

Eric Bohlman <> wrote:

>> Maybe the browser keeps submitting the form to the page itself
>> and autofocusing. Who knows, and who cares? Just do the right
>> thing, and let browsers do strange things with incorrect HTML.

>
> That wouldn't explain why he doesn't get the "error sound" with
> only one field, and in any case I think he left off the action
> because he was just trying to construct a short example, knowing
> full well that he'd need one in real life.


Really? I've seen so many form elements without action attributes in
real life, apparently based on a hope that browsers will do some
suitable guesses, or have client-side scripting enabled.

In this case, the behavior is indeed independent of the action
attribute. But it would be fair to expect a person with a problem post
a valid sample or its URL.

> The reason, I'm quite sure, is that when you have only one text
> field, or multiple text fields with a submit button, hitting enter
> has a defined result: submitting the form.


Actually, no. The HTML 4 specification does not define such things at
all. It does not describe all the ways that could be used to submit a
form. The HTML 2.0 spec had a vague statement about Enter perhaps
submitting a form, and browsers have implemented the idea in
devastatingly different and irritating ways, see
http://ppewww.ph.gla.ac.uk/~flavell/...mquestion.html

So it's undefined, no matter what the amounts of input elements and
other fields are.

What we have is yet another oddity from Microsoft. A form with multiple
text input fields _should not_ be submitted by simply hitting enter in
one field, whether there is a submit button or not - HTML 2.0 surely
didn't mean _that_. But people seem to have got so used to such
features that ask for them if they have been fixed in some special
cases.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump