Skip to content

Commit a7ad737

Browse files
ThomasLandauerjaviereguiluz
authored andcommitted
Adding label_html for asterisk
1 parent 58f47ea commit a7ad737

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
@@ -170,6 +170,8 @@ of the form type tree (i.e. it cannot be used as a form type on its own).
170170

171171
.. include:: /reference/forms/types/options/disabled.rst.inc
172172

173+
.. _reference-form-option-label:
174+
173175
.. include:: /reference/forms/types/options/label.rst.inc
174176

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

0 commit comments

Comments
 (0)