class_="checkbox"
Using <widget class_="checkbox">
creates a simple checkbox with a
label.
Syntax
<dynamic var=""> <widget class_="checkbox" label_="[LABEL_FOR_CHECKBOX]" value_="@var"> [1010data_QUERY] </widget> </dynamic>
The [1010data_QUERY] may be specified between the
opening and closing tags of the <widget>
. The results of the query
provide data for the <widget>
to display.
Attributes
The attributes in this list are specific to widgets with
class_="checkbox"
.
label_
- Accepts text that is used as a label for the widget.
labelpos_
- Accepts a string that specifies the position of the label for the widget.
Valid values are:
left
right
top
bottom
The default is
left
. labelwidth_
- Accepts an integer that specifies the width of the label for the widget.
If the length of the string specified by the
label_
attribute is greater than the value specified forlabelwidth_
, the text will wrap over multiple lines.If the
labelwidth_
attribute is not specified, the default width is the length of the string specified by thelabel_
attribute. value_
- Accepts a variable defined in the containing
<dynamic>
element. The value sent from thecheckbox
widget is stored in the variable provided. true_
- Accepts any value. This value is assigned to the variable specified in the
value_
attribute when the checkbox is checked. Default is1
. false_
- Accepts any value. This value is assigned to the variable specified in the
value_
attribute when the checkbox is unchecked. Default is0
. default_
- Accepts any value. If the value of
default_
is equal to the value oftrue_
, the checkbox will be checked. If the value ofdefault_
is any value other than that oftrue_
, the checkbox will be unchecked.
Example for class_="checkbox"
This example creates a simple checkbox, which is initialized to a checked value.
<dynamic var="1"> <widget class_="checkbox" label_="Check me!" value_="@var"/> </dynamic>
Results are shown below: