W3C home > Mailing lists > Public > www-html@w3.org > May 2001

Re: Default submit buttons

From: Clover Andrew <aclover@1value.com>
Date: Tue, 8 May 2001 12:12:57 +0200
Message-ID: <D58B0195B58937489E89124469E57CA20D4FEA@EX1.1value.com>
To: <www-html@w3.org>
Carsten H. Pedersen <chp@visholm.dk> wrote:

> How do I specify that the default submit button should
> be the *second* one defined?

If a form is submitted by an Enter-keypress in a text field,
then the submitted form data should include *neither* of the
submit-button name/value pairs. If neither value is passed
to the server-side script, it should decide itself which of
the actions was meant.

The problem is that IE4+ will, as you say, return the first
submit-button value when Enter is pressed. This is a bug in
IE, not something that needs changing in the spec, though
you might argue it would still be useful to specify a default
button since many window systems display the 'default' button
in a dialogue box differently to others.

Interestingly, this bug doesn't happen if there is only one
text field in the form. More:


...which also suggests a workaround of a 'dummy' first
submit button to swallow IE's obligatory-default problem.

Andrew Clover
Technical Consultant
Received on Tuesday, 8 May 2001 06:14:08 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:57 UTC