diff --git a/reference/forms/types/checkbox.rst b/reference/forms/types/checkbox.rst index 8f87683f180..ce751f5dbdf 100644 --- a/reference/forms/types/checkbox.rst +++ b/reference/forms/types/checkbox.rst @@ -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`_ | +| Options | - `false_values`_ | +| | - `value`_ | +-------------+------------------------------------------------------------------------+ | Overridden | - `compound`_ | | options | - `empty_data`_ | @@ -47,6 +51,7 @@ Example Usage Field Options ------------- +.. include:: /reference/forms/types/options/false_values.rst.inc .. include:: /reference/forms/types/options/value.rst.inc Overridden Options diff --git a/reference/forms/types/options/false_values.rst.inc b/reference/forms/types/options/false_values.rst.inc new file mode 100644 index 00000000000..22325dc5122 --- /dev/null +++ b/reference/forms/types/options/false_values.rst.inc @@ -0,0 +1,6 @@ +false_values +~~~~~~~~~~~~ + +**type**: ``array`` **default**: ``array(null)`` + +An array of values to be interpreted as ``false``.