Skip to content

issue-13589: adjust docs for custom-false-values for checkbox type #9031

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

Closed
Show file tree
Hide file tree
Changes from 3 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: 6 additions & 1 deletion reference/forms/types/checkbox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ CheckboxType Field

Creates a single input checkbox. This should always be used for a field
that has a boolean value: if the box is checked, the field will be set to
true, if the box is unchecked, the value will be set to false.
true, if the box is unchecked, the value will be set to false. Optionally
you can specify an array of values that, if submitted, will be evaluated
to "false" as well (this differs from what HTTP defines, but can be handy
if you want to handle submitted values like "0" or "false").

+-------------+------------------------------------------------------------------------+
| Rendered as | ``input`` ``checkbox`` field |
+-------------+------------------------------------------------------------------------+
| Options | - `value`_ |
| | - `false_values`_ |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the description of this option seems to be missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh! Indeed, sorry. Added.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and maybe we should sort the options alphabetically (i.e. put false-values before value). This must then also be taken into account below then.

+-------------+------------------------------------------------------------------------+
| Overridden | - `compound`_ |
| options | - `empty_data`_ |
Expand Down Expand Up @@ -48,6 +52,7 @@ Field Options
-------------

.. include:: /reference/forms/types/options/value.rst.inc
.. include:: /reference/forms/types/options/false_values.rst.inc

Overridden Options
------------------
Expand Down
6 changes: 6 additions & 0 deletions reference/forms/types/options/false_values.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
false_values
~~~~~
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line must contain as many ~ characters as the length of the headline


**type**: ``array`` **default**: ``array(null)``

An array of values to be interpreted as `false`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to backticks here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ops, two (not to) :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"doh!" again :D fixed