Actions

Difference between revisions of "Checkbox form field type"

From Joomla! Documentation

(Created page with "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 ...")
 
m
Line 4: Line 4:
 
* '''name''' (mandatory) is the unique name of the parameter.
 
* '''name''' (mandatory) is the unique name of the parameter.
 
* '''label''' (mandatory) (translatable) is the descriptive title of the field.
 
* '''label''' (mandatory) (translatable) is the descriptive title of the field.
* '''default''' (optional) is the default value of the checkbox
+
* '''value''' (optional) is the default value of the checkbox. If exist the checkbox will be checked by default.
 
* '''description''' (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
 
* '''description''' (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
 
* '''class''' (optional) is a CSS class name for the HTML form field.  If omitted this will default to 'inputbox'.
 
* '''class''' (optional) is a CSS class name for the HTML form field.  If omitted this will default to 'inputbox'.

Revision as of 16:11, 25 March 2012

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.

  • type (mandatory) must be checkbox
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • value (optional) is the default value of the checkbox. If exist the checkbox will be checked by default.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'inputbox'.

Example XML parameter definition:

<field name="mycheckbox" type="checkbox" label="Show title" description="" default="0" />

See also