Skip to Content

Form Element Advanced Field

Each form asset element has an "Advanced" field. Adding attributes into this field defines additional properties for the questions, such as datasets for possible answers and the size of an answer field. Attributes are always lowercase and in certain cases, more than one attribute can be included in the field. For them to function, however, these attributes must already be defined either within the XSL or CSS of the site; the default state of OU Campus does not necessarily have them defined.

Attribute Name

Syntax Example

Description

addclass

addclass=required;

Adds a class to the <span> that encapsulates the element. The class can be anything that has been defined in CSS.

To create a hidden field in a form, define a CSS class of  .hidden {display: none}, and then enter addclass=hidden in the Advanced field.

fieldset_start

fieldset_start=true;

Defines the opening tag for a <fieldset> tag within the form. This is used in conjunction with fieldset_end to set off a group of elements. In the examples that follow, it is indicated with a blue horizontal rule. It can also be used with fieldset_label to define a label for the group.

fieldset_end

fieldset_end=true;

Defines the closing tag for a fieldset and is used in conjunction with fieldset_start and fieldset_label. In the examples that follow, it is indicated with a blue horizontal rule.

fieldset_label

fieldset_label=About;

Defines the label of the fieldset. For example, if the group should be labeled “About,” then that can be defined here. It can be entered without quotes and can include spaces.

size

size=10;

Adds a size attribute to a single-line text field within the form. The size attribute is used to specify the viewable size of the field defined in characters. This does not determine the number of allowed input characters.

cols

cols=10;

Adds the cols attribute with the specified value to a multi-line text field form element. For HTML output this attribute specifies the visible width in average character widths. This does not determine the number of allowed input characters.

rows

rows=10;

Adds a rows attribute with the specified value to a multi-line text field. For HTML output this attribute specifies the number of visible text lines for a textarea. This does not determine the number of allowed input characters.

dataset

dataset=state;

Adds a predefined dataset to a radio button, checkbox, single-select, or multi-select element. This is useful for data that are frequently used, but tedious to type. For example, the “state” dataset includes all 50 United States so that they may be used in a selector element. Preconfigured datasets include:

state

state_ab

country

year

month

alphabet

numbers

form_classes

form_classes=well well-raised;

Adds one or more classes to the specified form node. See the following examples:

To add class="form-horizontal" use form_classes=form-horizontal

To add class="btn btn-mini" use reset_btn_classes=btn btn-mini;

To add a class to the submit button, use submit_btn_classes=class name;