xfboolean

Purpose

Defines a control to set binary values, for example a checkbox on a PC browser or a pair of radio buttons.

Note:

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.

Contained by

Attribute groups

Attributes

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   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   optional 

Example

<?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.

forms.mlyt

Related topics