These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:10 pm Advanced search

Form with submit button {display:none}

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

Form with submit button {display:none}

Postby silverroots » Fri Sep 09, 2011 3:44 am

Hello All,

There is an issue regarding form submit button which is little unclear from the specs mentioned in here http://www.whatwg.org/specs/web-apps/cu ... submission
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?

Thanks & Regards
- Kaustubh Atrawalkar
silverroots
<h6>
 
Posts: 2
Joined: Fri Sep 09, 2011 3:39 am

Re: Form with submit button {display:none}

Postby zcorpan » Fri Sep 09, 2011 10:42 am

The spec says

User agents may establish a button in each form as being the form's default button. This should be the first submit button in tree order whose form owner is that form element, but user agents may pick another button if another would be more appropriate for the platform.

It doesn't make any exception for 'display:none', so that shouldn't make any difference per spec.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Re: Form with submit button {display:none}

Postby silverroots » Mon Sep 12, 2011 4:29 am

Thanks zcorpan,
So as per your comment, It should work in any browser that implicit submission on submit button having display : none should submit the form in any case. We were trying to match with MSIE's behaviour where it does not.
silverroots
<h6>
 
Posts: 2
Joined: Fri Sep 09, 2011 3:39 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest