3. check-box

check-box(key, value, ..., key, value)

Inserts a check box control in generated content. This control can be used to edit the value of the element which is the target of the CSS rule. If "attribute, attribute_name" is specified, this control can be used to edit the value of an attribute of this target element.

KeyValueDefaultDescription
attributeQualified name of attribute to be editedNo defaultWithout this parameter, the control is used to edit the value of the element for which the control has been generated.
labelStringNoneLabel used for the check box.
unchecked-valueStringNone

In normal mode, unchecked-value must be specified. Unchecking the control assigns this value to the attribute or element value being edited.

See also remove value mode below.

checked-valueStringNone

In normal mode, checked-value must be specified. Checking the control assigns this value to the attribute or element value being edited.

See also remove value mode below.

allow-empty-checked-valueBoolean: yes|no, 1|0, "true"|"false", "on"|"off"no

Consider the empty string ("") to be an alias for checked-value (which must have been specified).

This parameter is used to implement XHTML5 form controls.

remove-valueBoolean: yes|no, 1|0, "true"|"false", "on"|"off"no

Turns remove value mode on and off.

In remove value mode, one but not both, of unchecked-value and checked-value must be specified:

  • if unchecked-value is not specified, unchecking the control removes the attribute being edited.

  • if checked-value is not specified, checking the control removes the attribute being edited.

If the value being edited is an element value rather than an attribute, instead of removing the attribute, the value of the element is set to the empty string.

Key, value, ..., key, value may also specify style parameters.

Examples:

check-box(attribute, value,
          unchecked-value, "false", 
          checked-value, "true")

check-box(label, "Yes", 
          unchecked-value, "no", 
          checked-value, "yes")

check-box(attribute, value,
          label, "Disabled", 
          checked-value, "disabled",
          remove-value, yes)

check-box(label, "Hidden", 
          checked-value, "hidden",
          remove-value, yes)