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

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