[whatwg] HTMLForms: Implicit Submission with {display:none} button

Ian Hickson ian at hixie.ch
Fri Jun 29 14:24:12 PDT 2012

On Tue, 21 Feb 2012, Boris Zbarsky wrote:
> On 2/21/12 10:47 PM, Dimitri Glazkov wrote:
> > I made WebKit match this behavior a couple of years ago: 
> > https://bugs.webkit.org/show_bug.cgi?id=9756
> Ah, interesting.  Some of the links in that bug indicate that people are 
> in fact depending on this behavior....

I've tried to define this in the spec. It's a bit esoteric, but...

Let me know if it's not quite right. I wasn't sure exactly what weird 
things to test. I mostly relied on WebKit's (specifically Chrome's) 
behaviour here since they were apparently the ones most recently affected 
by real compat reasons to implement something here so maybe they are the 
closest to what the Web today actually needs (?).

On Tue, 3 Apr 2012, Boris Zbarsky wrote:
> On 4/3/12 5:14 PM, Glenn Maynard wrote:
> > Ten years later it's still giving me headaches, when I try to do a 
> > trivial two-input login form without a browser submit button, and find 
> > that every obvious way of hiding the submit button breaks implicit 
> > submit in one browser or another.  Do I really need to stick the 
> > submit button in an overflow: hidden, 0x0 div?  I know I found a less 
> > ugly workaround for this the last time I hit this...
> Well, the fact that display:none makes it not submit is clearly a 
> browser bug in the browsers it happens in.


On Tue, 21 Feb 2012, Glenn Maynard wrote:
> I don't think the existence of implicit submit should depend on platform 
> conventions, though, for interop on forms without visible submit 
> buttons. The form implicit submit takes is a platform convention, but it 
> should be required to exist in some form or another.

User agents aren't actually required to let users input anything, so it 
doesn't make much sense to require submission be possible...

On Thu, 24 May 2012, Rob Crowther wrote:
> On 22/02/12 00:35, Ian Hickson wrote:
> > I've changed the spec to be clearer that CSS cannot be taken into 
> > account when determining the default. The default button is just 
> > always the first submit button in the form.
> What about the situation where there isn't a button?  Implicit 
> submission still seems to happen on forms which have just a single 
> element, for example:
> http://www.boogdesign.com/examples/forms2/test-validate-1.html 
> http://www.boogdesign.com/examples/forms2/test-validate-2.html
> These both trigger the form validation algorithm in Firefox, Opera & 
> Chrome if you just hit return.  This form with two inputs doesn't 
> trigger implicit submission:
> http://www.boogdesign.com/examples/forms2/test-validate-3.html
> But add a submit button and it does:
> http://www.boogdesign.com/examples/forms2/test-validate-4.html
> Because in everything hinges on the 'default button' this 
> behaviour doesn't seem to be covered.  Is this intentional?

I've updated the spec to hopefully better match this, as noted above.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list