For Adobe ColdFusion application servers Radio

A radio format field creates a set of radio buttons from a list or query. The Radio format is the same as checkbox, except the attribute multiple defaults to No (for example, if you specify format="radio" multiple="Yes" then TerraForm will build checkboxes instead of radio buttons).

TerraForm recognises the following special attributes for radio format:

  • Cols
    Optional, defaults to 2. Number of columns in which to display the checkboxes. Set cols=1 for one long column, or cols=0 for one long row.
  • Group
    Optional, boolean, defaults to false. Group buttons using HTML fieldset and legend tags.
  • tablePassthrough
    Optional. The radio buttons are presented in a row/column layout using regular table tags. This attribute provides the ability to pass attributes through to the table tag wrapped around the radio buttons. Remember to escape any double quotes (") or hashes / pound signs (#) by doubling them. See the example below.
  • tdPassthrough
    Optional. Attributes to pass through to the td tag wrapped around each individual radio button. 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 with tablePassthrough and tdPassthrough or 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 with tablePassthrough and tdPassthrough. 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 radio tags (<input type="radio">). For example:

  • onMouseOver="click()"
  • disabled
  • style="background-color : ##cccccc; border : 1px solid black; margin-left : 20px"

Examples

A plain radio field. This one is returning a string. Since there is no displaylist attribute, the valuelist will server for both the display and the value.

<cf_terrafield
  name="MyRadioField1"
  caption="Subphylum Vertebrata"
  format="radio"
  datatype="string"
  valuelist="Agnatha (jawless fishes),Osteichthyes (bony fishes),Chondrichthyes (cartilaginous fishes),Amphibia (amphibians),Reptilia (reptiles),Aves (birds),Mammalia (mammals)"
  group=true	
/>
Subphylum Vertebrata

A radio field built from a query (this one is returning an integer - perhaps the product ID):

<cf_terrafield
  name="MyRadioField2"
  format="radio"
  datatype="integer"
  query="SearchResults"
  valuecolumn="AlbumID"
  displaycolumn="AlbumName"
  cols="1"
  default="1006"
  tdpassthrough="style=""font-face : courier new,courier,monospace"""
/>

HyperText Markup Language
The coding language used to create hypertext documents for use on the World Wide Web.
No comments yet