Attribute | Required | Values | Default Value | Explanation |
---|---|---|---|---|
caption (aka: label, alt) | No | Any text | n/a | If a caption is present for a non-root Choice field, it will be displayed beneath the choice’s image whenever the choice is to be presented as an answer. For root choices, the caption will only ever be displayed above the choice field if it is on a page. To control how the caption is displayed on non-root items see the captionHeight attribute. |
value | No | Any text | n/a | The value that this choice represents when the user selects it as an answer (i.e. the data to record for this field, if this choice was a leaf of the choice tree). |
img | No | Relative Path to Image File | n/a | The image to display for this choice when it is presented to the user as one possible answer to a question. |
captionHeight | No | Any decimal between 0 and 1 (inclusive) | 0.25; or 0 when caption is given using the alt alias; or inherited from parent choice | Determines what proportion of the UI element that represents the choice as an answer should be taken up by the caption text, as opposed to the corresponding image. For example, setting captionHeight to 0.4 would give 60% of the choice’s height to its image and the remaining 40% to the textual caption. |
matchTextSize | No | true, false | true; or inherited from parent choice | Whether or not the font size of text displayed on choices (as captions or instead of an image) should be coordinated across choice siblings (i.e. per “screen”). |
backgroundColor | No | Hex colour code (e.g. #000000) | #FFFFFF (white) | Background colour for the UI element that represents this choice when presented as an answer, expressed as a hexadecimal #RRGGBB code. |
crossed | No | true, false | false | Whether or not a cross should be positioned on top of the UI element for this choice when it is presented as an answer. |
crossColor | No | Hex colour code (e.g. #000000) | #A5FF0000 (Red with 65% alpha) | The colour of the cross that could be positioned on top of the choice, expressed as a hexadecimal #AARRGGBB code (supports an opacity value). |
noColumn | No | true, false | false | Setting this attribute to true on the root of a choice tree (it is ignored on children) specifies that the choice tree will not produce any data (i.e. the field will not be backed by a database column). Such choice trees without a column are useful as a means to direct control flow in a form or project. |
cols | No | Any positive whole number | 1 | The number of columns with which to display children (answers) of this choice when it is presented as a question. |
rows | No | Any positive whole number | 2 | The number of rows with which to display children (answers) of this choice when it is presented as a question. |