Skip to content

[form] action tag breaks in PR #16029 #16038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jaytaph opened this issue Oct 1, 2015 · 2 comments
Closed

[form] action tag breaks in PR #16029 #16038

jaytaph opened this issue Oct 1, 2015 · 2 comments

Comments

@jaytaph
Copy link
Contributor

jaytaph commented Oct 1, 2015

PR #16029 removes the 'action' attribute from a form when the data is empty. This however, is incorrect behaviour according to the HTML specifications, even though URI's according to RFC 2396 section 4.2 states that empty URI's are considered same-document references.

In HTML4, the action attribute is required, yet it might contain an empty URI (and thus references to same-document). This is specified in the HTML4 specification (http://www.w3.org/TR/html4/interact/forms.html#h-17.3), section 17.3.

In HTML5 however, the action attribute is optional, but if specified, it must point to a "valid non-empty URL potentially surrounded by spaces".

This was already discussed in issue #13852.

To recap:

attribute html4 html5
yes yes
yes no
no yes

This is why originally i've added an omit_action option (PR #15995) to the form type: it's not possible to distinguish between a html4 or html5 rendered form, and thus the user must tell explicitly if either A) the action must be added (but should be empty) or B) the action must not be added at all.

@jaytaph jaytaph changed the title Form action breaks in PR #16029 [form] action tag breaks in PR #16029 Oct 1, 2015
@Tobion
Copy link
Contributor

Tobion commented Oct 1, 2015

Does the html4 form without action not submit to the current document? Or what is the actual bug you experience?

@Tobion
Copy link
Contributor

Tobion commented Oct 1, 2015

I tested it and html4 without an action is supported by all major browsers. The core team agreed to default to valid html5 beginning with symfony 2.8. If you want to validate against html4, just use action='#' or change your form theme. A new option for this is overkill.
Please see the discussion in the original ticket.

@Tobion Tobion closed this as completed Oct 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants