NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 938 - Empty form action="" attribute is not allowed (spec conflict)
Empty form action="" attribute is not allowed (spec conflict)
Status: RESOLVED INTENTIONAL
Product: Validator.nu
Classification: Unclassified
Component: HTML5 schema
HEAD
All All
: P2 normal
Assigned To: Nobody
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-04 02:24 CEST by David Turover
Modified: 2012-09-04 18:20 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Turover 2012-09-04 02:24:48 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?
Comment 1 Michael[tm] Smith 2012-09-04 18:20:13 CEST
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