General Operation

The general operation of form elements such as displaying and modifying their contents, possibly by using certain helper windows, is described in this section.

Displaying Elements

The current contents of a form element, now denoted as the value, is displayed inline within the formatted hypertext that is presented by a viewer window. The shown value is enclosed within a certain pair of characters that depend on the element type, in order to make the distinction from surrounding text easier, e.g. in cases when no other attributes such as colors are in use.

The display area for the shown value is allocated during parsing of the document and cannot be changed afterwards. Furthermore, that area is never broken across lines and its size never exceeds the width of the window. For that reason, the value to be shown is truncated if it is too long and is filled with "_" characters if it is too short for the display area. Some element values consist of multiple items (lines, options, files, ...), so that in these cases the first suitable non-empty item value is used as the value to be shown.

In case the cursor of a viewer window is being positioned on a form element, its type together with its assigned name (if specified) as it is to be used during form submission is displayed as a pseudo URL in the status bar, e.g. input:text("txt") or input:checkbox("chk"), but evaluation of such a URL by itself does not cause anything to happen. Submit and image button elements are also displayed with their type, but instead of the assigned name, the submission method and the resolved target URL are shown, e.g.

input:submit("post","http://localhost/cgi-bin/debug.cgi")

One kind of form element does not appear of its own and is therefore never shown: Hidden elements are used to hold certain values that are to be sent back again to a server as is, together with the rest of the formular.

Modifying Elements

Modification of a form element value, if designated for this action at all, is not directly possible with all element types. Only checkboxes and radio buttons are capable of doing this immediately by activation of the element. Other elements have to be activated first in order to be able to change their value. Then, in doing so, a helper window is opened to perform the modification and finally, when accepted, the new value is taken over and is shown anew in the hypertext display.

Helper Windows

The structure of a helper window itself, which is opened by some form elements in order to be able to modify their value, is almost identical to that of dialogs (see also section "Structure of Dialogs"). One or more input fields of different kinds are provided and two mandatory buttons are available: At the lower left, the button Accept is used to take over the current value, while the button Cancel, located at the lower right, is used to discard any changes.

The size of a helper window is independent of related attribute values that are eventually specified on the originating element from which an element is derived, in contrast to the size of the display area. This behavior is intended in order to guarantee that an element value can be edited or selected in a uniform way without being hindered by probably ill-sized input fields.

When available, a label is attached to the input field in question and is located directly above it. This label is usually derived from the title attribute of the originating element and is generally meant to hint the user about what kind of value to enter or select and its intended purpose.