Skip to content

Commit a0a88a2

Browse files
committed
Documented the false_values option of checkbox types
1 parent 8dd54bb commit a0a88a2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

reference/forms/types/checkbox.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ CheckboxType Field
66

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

1114
+-------------+------------------------------------------------------------------------+
1215
| Rendered as | ``input`` ``checkbox`` field |
1316
+-------------+------------------------------------------------------------------------+
14-
| Options | - `value`_ |
17+
| Options | - `false_values`_ |
18+
| | - `value`_ |
1519
+-------------+------------------------------------------------------------------------+
1620
| Overridden | - `compound`_ |
1721
| options | - `empty_data`_ |
@@ -48,6 +52,13 @@ Example Usage
4852
Field Options
4953
-------------
5054

55+
false_values
56+
~~~~~~~~~~~~
57+
58+
**type**: ``array`` **default**: ``array(null)``
59+
60+
An array of values to be interpreted as ``false``.
61+
5162
.. include:: /reference/forms/types/options/value.rst.inc
5263

5364
Overridden Options

0 commit comments

Comments
 (0)