Configure a checkboxto display or accept user input for a property that has two values.
If a Single Value
mode property has the Type True
or False
, the system uses only the two lowercase text values
true
and false
for values. By convention,
true
corresponds to the checked state.
If you use a checkbox to display or accept user input for a
Single Value
property that is not of type True
or False
, some care is needed to plan for the text clipboard value
that represents the cleared (unchecked state).
The HTML element has the form:
<INPUT TYPE= "CHECKBOX" ...>
This element identifies only the checked value, not the cleared (unchecked) value.
If you specify true
, T
, t
,
Y
, y
, or 1
as the checked value in
HTML, and the user clears the checkbox, the system records
false
, F
, f
, N
,
n
or 0
as the clipboard value respectively.
(The converse cases apply, but they are to be avoided as they confuse
communications between users and developers.)
Avoid specifying a text string value other than one of these twelve values as the checked value in your source HTML, because results may be unexpected.
For example, if the exact text values "North" and "South" are property values, use option buttons, not a checkbox, to present the property to users. If you specify VALUE="North" in a checkbox and the user submits the form containing a cleared checkbox, the clipboard value recorded is the null string, not South. With option buttons, you specify both text values in the HTML.
Save your checkbox HTML into an HTML Property rule. Then, reference that HTML Property in a property. Finally, reference the property in an HTML rule.
The syntax for a checkbox can look like:
{when $mode-show}
<INPUT TYPE="checkbox"
VALUE="true" READONLY >
{else}
<INPUT TYPE="checkbox"
VALUE="true" >
{end}