Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Merge branch '5.2' into 5.3
Browse files Browse the repository at this point in the history
* 5.2:
  Adding label_html for asterisk
  • Loading branch information
javiereguiluz committed May 21, 2021
2 parents 9ab06d8 + 54f6618 commit 94df07b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
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>`
or :ref:`label_html <reference-form-option-label-html>` options instead.

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

Expand Down
4 changes: 4 additions & 0 deletions reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,12 @@ 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

.. _reference-form-option-label-html:

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

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

0 comments on commit 94df07b

Please sign in to comment.