W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2011

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

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Sat, 24 Sep 2011 09:47:04 -0700
Message-ID: <CABNRm61U5T3BGoX7U5nQD+p9eWc2EtqQnTy0WdpspSNykzMdag@mail.gmail.com>
On Fri, Sep 23, 2011 at 10:10 PM, Kaustubh Atrawalkar <kaustubh at motorola.com
> wrote:
>  > > If the form has submit button with display property as none, will that
> > > form should be implicitly submitted on pressing enter key? This works
> in
> > > Opera & Firefox but does not work in IE & Safari as of now. What is the
> > > expected behavior for this?
> >
> > The strict answer is that it's up to the browsers; the spec allows
> > browsers to do whatever they think is appropriate per their platform's
> > conventions. So both behaviours are compliant.
> But then this might result in website compliance issue. A website having
> username, password field with hidden submit button expecting to login on
> enter key using forms implicit submission will work on FF & Opera but may
> not work on IE & Safari.

WebKit's behavior is very confusing here. It does implicit submission in the
following conditions:

   - One text fields
   - Two text fields
   - One text field with one visible submit button
   - Two text fields with one visible submit button
   - Two text fields with one visibility:hidden submit button
   - One text field with one display:none submit button

However, it doesn't submit when we have:

   - Two text fields with one display:none submit button

Given that WebKit implicitly submits form even in the presence of a visible
submit button or an invisible submit button (visibility: hidden, or display:
none with exactly one text field), I don't see why we should avoid implicit
submission only when there are multiple form controls and a display:none
submit button.

- Ryosuke
Received on Saturday, 24 September 2011 09:47:04 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:36 UTC