Skip to content

Adding label_html for asterisk #15237

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

Merged
merged 1 commit into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions form/bootstrap4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ is a strong connection between the error and its ``<input>``, as required by the
``form_label()`` internally. If you call to ``form_errors()`` in your template,
you'll get the error messages displayed *twice*.

.. tip::

Since form errors are rendered *inside* the ``<label>``, you cannot use CSS
``:after`` to append an asterisk to the label, because it would be displayed
after the error message. Use the :ref:`label <reference-form-option-label-html>`
option instead.

Checkboxes and Radios
---------------------

Expand Down
2 changes: 2 additions & 0 deletions reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ of the form type tree (i.e. it cannot be used as a form type on its own).

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

.. _reference-form-option-label:

.. include:: /reference/forms/types/options/label.rst.inc

.. include:: /reference/forms/types/options/row_attr.rst.inc
Expand Down