Skip to content

Commit d4f353e

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: Adding label_html for asterisk
2 parents 1ab7896 + 5818046 commit d4f353e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-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-html>`
96+
option instead.
97+
9198
Checkboxes and Radios
9299
---------------------
93100

reference/forms/types/form.rst

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

176176
.. include:: /reference/forms/types/options/disabled.rst.inc
177177

178+
.. _reference-form-option-label:
179+
178180
.. include:: /reference/forms/types/options/label.rst.inc
179181

180182
.. include:: /reference/forms/types/options/label_html.rst.inc

0 commit comments

Comments
 (0)