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

RE: Default Submit Button

From: Burnett, Simon <SBurnett@calorgas.co.uk>
Date: Mon, 10 Sep 2001 16:32:25 -0000
Message-ID: <10CF2A162673D311BA5E0000F67A136E033FDEB0@CGTPSVR1>
To: www-html@w3.org
Another method could be to capture the 'ENTER' keypress and ignore it,
forcing users to click on the desired SUBMIT button. 

If this causes hassle for users what about adding a function to your form
fields capturing keypresses and when ENTER is hit run the appropriate form
submit process. Bit of a headache for big forms. May confuse users though!

Good luck.

Simon.

-----Original Message-----
 
Clark C . Evans <cce@clarkevans.com> wrote:

> How do I specify that a particular button is
> the default submit button?

You can't, because HTML has no concept of a 'default submit button'.
This is specifically an Internet Explorer problem.

To get around the problem you could use hidden or dummy submit/image
form controls to 'swallow' the enter-submission (which could then be
routed to a different button using JavaScript).

For more about this irritating issue, see
http://ppewww.ph.gla.ac.uk/~flavell/www/formquestion.html .

-- 
Andrew Clover
Technical Consultant
1VALUE.com AG

----------------------------------------------------------------------------
--------------------------
The contents of this e-mail are confidential and it is intended for the
recipient at the e-mail address to which it has been addressed.  This e-mail
may not be disclosed to or used by anyone other than the addressee nor may
it be copied or forwarded to third parties without the express permission of
Calor.  Calor disclaim all liability for any statements made by the sender
which do not directly concern the business of Calor and Calor denies any
contracts purported to be concluded on behalf of Calor by means of an e-mail
communication.

Neither Calor nor the sender accepts any responsibility or liability for
viruses and it is the responsibility of the recipient to scan this e-mail
and any attachments to satisfy itself that the e-mail is virus free.

If this e-mail is received in error, please contact Calor
(HTTP:\\www.calorgas.co.uk) on (0)1926 330088 quoting the name of the sender
and the addressee and then both delete it from your system and from your
deleted items folder.
----------------------------------------------------------------------------
--------------------------  
Received on Monday, 10 September 2001 11:34:58 GMT

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