Skip to content

Commit 94df07b

Browse files
committed
Merge branch '5.2' into 5.3
* 5.2: Adding label_html for asterisk
2 parents 9ab06d8 + 54f6618 commit 94df07b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

form/bootstrap4.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ is a strong connection between the error and its ``<input>``, as required by the
8888
``form_label()`` internally. If you call to ``form_errors()`` in your template,
8989
you'll get the error messages displayed *twice*.
9090

91+
.. tip::
92+
93+
Since form errors are rendered *inside* the ``<label>``, you cannot use CSS
94+
``:after`` to append an asterisk to the label, because it would be displayed
95+
after the error message. Use the :ref:`label <reference-form-option-label>`
96+
or :ref:`label_html <reference-form-option-label-html>` options instead.
97+
9198
Checkboxes and Radios
9299
---------------------
93100

reference/forms/types/form.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,12 @@ of the form type tree (i.e. it cannot be used as a form type on its own).
179179

180180
.. include:: /reference/forms/types/options/disabled.rst.inc
181181

182+
.. _reference-form-option-label:
183+
182184
.. include:: /reference/forms/types/options/label.rst.inc
183185

186+
.. _reference-form-option-label-html:
187+
184188
.. include:: /reference/forms/types/options/label_html.rst.inc
185189

186190
.. include:: /reference/forms/types/options/row_attr.rst.inc

0 commit comments

Comments
 (0)