For Adobe ColdFusion application servers Boolean

A boolean format field is the ideal way to collect boolean or bit data. It simply creates a checkbox but, unlike regular HTML checkboxes, it guarantees that a valid form will return a value. With a regular checkbox, the field will only return a value if checked.

The following special attribute is available for boolean:

  • labelPassthrough
    Optional. Attributes to pass through to the label tag wrapped around the checkbox and the text caption. Remember to escape any double quotes (") or hashes / pound signs (#) by doubling them. See the third example below.

Non-TerraField attributes will be passed through to the underlying checkbox tag (<input type="checkbox">). For example:

  • style="background-color : red"
  • disabled
  • onclick="submit()"
  • accesskey="A"
  • tabindex="4"

The last example below uses the sqBit datatype that is part of the Microsoft SQL Server Extension Pack. sqBit returns 0 or 1 instead of No or Yes. If you are working with Server, you may prefer to set up a preset in your TerraForm Settings file that defines sqBit as the default datatype for the Boolean format.

Examples

A plain Boolean field:

<cf_terrafield
  name="MyBoolean1"
  format="boolean"
/>

A Boolean field that defaults to Yes:

<cf_terrafield
  name="MyBoolean2"
  datatype="boolean"
  format="boolean"
  caption="Sign me up"
  default="Yes"
/>

A Boolean field that returns a bit (0 or 1) instead of Yes or No:

<cf_terrafield
  name="MyBoolean3"
  datatype="sqbit"
  caption="extra cheese"
  format="boolean"
  labelpassthrough="style=""background-color : ##ffcc00; padding : 4px""" 
/>

Structured Query Language
A language for getting information from and updating a database.
HyperText Markup Language
The coding language used to create hypertext documents for use on the World Wide Web.
No comments yet