The checkbox form field type provides a single checkbox. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Example XML field definition:

<field name="show_title" 
type="checkbox"
label="Show title"
description="Show the title of the item"
value="1" />

Example XML field definition (checked):

<field name="show_title"
type="checkbox"
label="Show title"
description="Show the title of the item"
value="1"
checked="1" />

Parameters

Mandatory Parameters

  • type must be checkbox
  • name is the unique name of the parameter
  • label (translatable) is the descriptive title of the field

Optional Parameters

  • value is the value of the parameter if this checkbox is set (usually 1)
  • checked: should be set to 1 to check the checkbox by default or 0 not to
  • description (translatable) is text that will be shown as a tool tip when the user moves the mouse over the label
  • class is a CSS class name for the HTML form field. If omitted this will default to 'inputbox'