8000 bug #26584 [TwigBridge] allow html5 compatible rendering of forms wit… · symfony/symfony@a1be12e · GitHub
[go: up one dir, main page]

Skip to content

Commit a1be12e

Browse files
committed
bug #26584 [TwigBridge] allow html5 compatible rendering of forms with null names (systemist)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #26584). Discussion ---------- [TwigBridge] allow html5 compatible rendering of forms with null names Fixes html5 validation error with null form names. Commits ------- 01c9e3c allow html5 compatible rendering of forms with null names
2 parents 0877bf6 + 01c9e3c commit a1be12e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@
275275
{%- else -%}
276276
{% set form_method = "POST" %}
277277
{%- endif -%}
278-
<form name="{{ name }}" method="{{ form_method|lower }}" action="{{ action }}"{% for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %}>
278+
<form{% if name != '' %} name="{{ name }}"{% endif %} method="{{ form_method|lower }}" action="{{ action }}"{% for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %}>
279279
{%- if form_method != method -%}
280280
<input type="hidden" name="_method" value="{{ method }}" />
281281
{%- endif -%}

0 commit comments

Comments
 (0)
0