InputfieldCheckbox class

An Inputfield for handling a single checkbox

Note: if you want a checkbox already checked, you need to $inputfield->setAttribute('checked', 'checked');


Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the InputfieldCheckbox class also inherits all the methods and properties of: Inputfield, WireData and Wire.

Show class?     Show args?       Only hookable?    

Properties

NameReturnSummaryDefault
InputfieldCheckbox::autocheck int When set to 1, setting value attribute to non-blank/non-zero automatically triggers checked. 0
InputfieldCheckbox::checkboxLabel string Same as label2, but used as part of field config rather than API-only config. 
InputfieldCheckbox::checkboxOnly bool Show only the checkbox without label text next to it? 3.0.144false
InputfieldCheckbox::checkedValue string Value when checked 1
InputfieldCheckbox::label2 string Alterate label to display next to checkbox label
InputfieldCheckbox::labelAttrs array Optional attributes for <label> element that surrounds checkbox 3.0.141[]
InputfieldCheckbox::uncheckedValue string Value when not checked ''

Additional methods and properties

In addition to the methods and properties above, InputfieldCheckbox also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.251