Bugzilla – Bug 938
Empty form action="" attribute is not allowed (spec conflict)
Last modified: 2012-09-04 18:20:13 CEST
The validator produces an error for a page with an empty form action="" attribute: Error: Bad value for attribute action on element form: Must be non-empty. Syntax of IRI reference: Any URL. For example: /hello, #canvas, or http://example.org/. The html5 form submission algorithm at 4.10.22.3 item 9 allows an empty action attribute to support legacy browser behaviour. http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#form-submission However, Bug #810 changed the language spec at 4.10.19.5 to disallow empty action attributes because "those get processed in an unexpected way". FWIW, I would prefer to keep the legacy behaviour. Is it possible for the schema to define the action attribute as either a URL or an empty string?
Bug 810 didn't change the spec. It was a change to the schema that was was made in response to a spec change: http://html5.org/r/5784 See the relevant part of the current spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#attr-fs-action "The action and formaction content attributes, if specified, must have a value that is a valid non-empty URL potentially surrounded by spaces." So the schema and validator conform to the current spec. So to get the behavior changed, you should file a bug against the spec: https://www.w3.org/Bugs/Public/enter_bug.cgi?product=WHATWG&component=HTML