Checkbox
A checkbox format field creates a set of checkboxes from a list or query. The checkbox format is the same as radio, except the attribute multiple defaults to Yes (for example, if you specify format="checkbox" multiple="No" then TerraForm will build radio buttons instead of checkboxes).
Note, if you want to use a single checkbox to retrieve a boolean result (e.g. "Yes, send me free offers by email!") use the boolean format and datatype instead.
TerraForm recognises the following special attributes for checkboxes:
-
Group
Optional, boolean, defaults to false. Group buttons using HTMLfieldsetandlegendtags. -
Cols
Optional, defaults to 2. Number of columns in which to display the checkboxes. Setcols=1for one long column, orcols=0for one long row. -
tablePassthrough
Optional. The checkboxes are presented in a row/column layout using regular table tags. This attribute provides the ability to pass attributes through to thetabletag wrapped around the checkboxes. Remember to escape any double quotes (") or hashes / pound signs (#) by doubling them. See the example below. -
tdPassthrough
Optional. Attributes to pass through to thetdtag wrapped around each individual checkbox. Remember to escape any double quotes (") or hashes / pound signs (#) by doubling them. See the example below. -
gridstart, gridend, rowstart, rowend, cellstart, cellend (new in 2.5)
Optional. By default, TerraForm uses a simple table to layout your checkboxes. You can manipulate the layout withtablePassthroughandtdPassthroughor you can take total control by provide your own replacement markup using this set of six attributes. Note: Do not use these attributes in combination withtablePassthroughandtdPassthrough. For a good sample of the utility of these attributes, look at the Multiple-choice survey sample in the downloadable code gallery.
Other non-TerraField attributes will be passed through to the underlying checkbox tags (<input type="checkbox">). For example:
onMouseOver="click()"disabledstyle="background-color : ##cccccc; border : 1px solid black; margin-left : 20px"
