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

>
> >
> > 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.


> The guidelines in the spec do not say anything about the behaviour being
> different for elements that are display:none or otherwise hidden, though,
> so I don't see any reason to consider the visibility of a button in making
> the decision as to which button is the default.
>
> Second to your opinion, on the last line of the specs paragraph it says -
"If the form has no submit button, then the implicit submission mechanism
must just submit the form element from the form element itself."
http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#implicit-submission


- Kaustubh

Received on Friday, 23 September 2011 22:10:20 UTC