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:

http://ppewww.ph.gla.ac.uk/%7Eflavell/www/formquestion.html

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

-- 
Andrew Clover
Technical Consultant
1VALUE.com AG
Received on Tuesday, 8 May 2001 06:14:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:48 GMT