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

Ian Hickson ian at hixie.ch
Fri Sep 23 11:52:31 PDT 2011


On Fri, 23 Sep 2011, Kaustubh Atrawalkar wrote:
>
> There is an issue regarding form submit button which is little unclear 
> from the specs [...]
>
> 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.

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.

HTH.

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