Combo
A combo format field creates a select box from a list or query. However, in addition to picking values the user may also enter their own values. This is a convenient way to present common choices while allowing new choices to be added. It should be considered that some users struggle to understand the concept of a combo box. The format may be of more use in administration forms than for forms designed for the general public.
If you are building the field from a list, you must specify a valuelist, optonal displaylist (the displayed equivalent of each value) and optional delimiters. If you are building the field from a query, you must specify a valuecolumn, and optonal displaycolumn (the column containing the displayed equivalent of each value).
Specify groupList or groupColumn to employ groups within your select box implemented using the HTML optgroup element. All values with the same group value will be grouped together. For example:
<cf_terrafield name="locationId" format="select" query="locations" valueColumn="locationId" displayColumn="locationName" groupColumn="regionName" />
If specified, the prompt and promptvalue attributes will be used to generate the first item in the list. For example, prompt="> Choose <". promptvalue is the value submitted if the prompt is selected when the form is submitted.
Note that if your list data contains commas, you will need to use and specify an alternative delimiter for your list using the delimiters attribute. This is not a concern with query data.
The following special attribute is available for combo:
-
width
Optional, defaults to 100. Width of the field in pixels.
Other non-TerraField attributes will be passed through to the underlying input type="text" tag..
