Skip to content

Commit 3ec7323

Browse files
committed
[reference][forms] Updating choice tag for new empty value behavior
1 parent 052203c commit 3ec7323

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

reference/forms/types/choice.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,16 @@ Adding an "empty value"
8787

8888
If you're using the non-expanded version of the type (i.e. a ``select`` tag)
8989
element and you'd like to have a blank entry (e.g. "Choose an option") at
90-
the top of the select box, you can easily do so:
90+
the top of the select box, you can easily do so by doing the following:
9191

92-
* Set the ``multiple`` option to false
93-
* Set the ``required`` option to false
92+
* Set the ``multiple`` option to false;
9493

95-
With these two options, a blank choice will display at the top of the select
96-
box. To customize what that entry says, add the following when rendering
97-
the field:
94+
* Set the ``required`` option to false or explicitly pass in the ``empty_value``
95+
option in the template (as shown below).
96+
97+
If ``required`` is true, a blank choice will display at the top of the select
98+
box. To customize what that entry says (or if you have ``required`` set to
99+
``false``), add the following when rendering the field:
98100

99101
.. configuration-block::
100102

0 commit comments

Comments
 (0)