Defines a control to set binary values, for example a checkbox on a PC browser or a pair of radio buttons.
The trueValue and falseValue attributes can be either a single text string or a set of comma separated values. If a single text string is used, the attribute forms the label for the control.
Attribute | Description | Type | Default | Options | Use |
---|---|---|---|---|---|
errmsg | The error message to be issued if the control fails validation | xs:string | none | optional | |
falseValue | The text displayed when the control is set to false | xs:string | 0 | optional | |
initial | The initial value of the control | xs:integer | none | optional | |
name | The name of the control and the form variable return to the server | xs:string | none | required | |
trueValue | The text displayed when the control is set to true | xs:string | 1 | optional |
<?xml version="1.0" encoding="UTF-8"?>
<canvas layoutName="/forms.mlyt" pageTitle="xfboolean">
<xfform name="formControls" action="test.jsp">
<xfboolean
name="mailnews"
caption="Send me news updates"
captionPane="controlCaption1"
entryPane="controlEntry1"
falseValue="No"
trueValue="Yes"
initial="1"/>
</xfform>
</canvas>
The forms.mlyt layout may have the following structure.