Cocoon Forms: booleanfield widget (2.1 legacy document)
Warning
This document was copied as is from the Cocoon 2.1 documentation, but has not
yet been fully reviewed or moved to its new home.
Concept
An fd:booleanfield is a field that has a value of true or false. Usually is rendered as a checkbox.
It is different from a field widget with a boolean datatype because an HTML checkbox submits no request parameter if the checkbox is unchecked. If you would render it instead as a listbox with true and false values, you could also use a regular field widget. Since the styling preference might change over time, it is however better to use consistently the fd:booleanfield widget.
A booleanfield cannot be marked as "required", because it is always required. It is either true or false. If you want tripples (true/false/none), use a normal field widget with a selection list.
Configuration
<fd:booleanfield id="..."> <fd:label>...</fd:label> <fd:help>...</fd:help> <fd:hint>...</fd:hint> <fd:on-value-changed> [...] </fd:on-value-changed> </fd:booleanfield>
See field wiget for a description of the configuration options.