|
TWiki Forms - Foundation of TWiki Applications |
|
- Tooltip message column: The
Tooltip message will be displayed when the cursor is hovered over the field in edit view.
|
|
< < |
- Attributes column:
Attributes specifies special attributes for the field. Multiple attributes can be entered, separated by spaces.
- An attribute
H indicates that this field is hidden, e.g. not shown in view mode. However, the field is available for editing and storing information.
|
> > |
- Attributes column:
Attributes may contain additional key="value" form field attributes, separated by space.
- A
hidden="1" attribute indicates that this field is hidden, e.g. not shown in view mode. However, the field is available for editing and storing information. The deprecated H attribute has the same function, it is still supported but might be removed in a future TWiki release.
|
| Tip: The TWiki form header is suppressed in view mode if all fields of the form are hidden. For better usability it is good to hide the whole form if the display and interaction of all form fields is done externally. For example, the display and modification of form field values can be done in a header topic that is included in each page. |
|
< < |
-
- An attribute
M indicates that this field is mandatory. The topic cannot be saved unless a value is provided for this field. If the field is found empty during topic save, an error is raised and the user is redirected to an oops page. Mandatory fields are indicated by an asterisks next to the field name.
|
> > |
-
- An
mandatory="1" attribute indicates that this field is mandatory. The topic cannot be saved unless a value is provided for this field. If the field is found empty during topic save, an error is raised and the user is redirected to an oops page. Mandatory fields are indicated by an asterisks next to the field name. The deprecated M attribute has the same function, it is still supported but might be removed in a future TWiki release.
- Additional form field type specific attributes can be used, such as
onfocus="..." and spellcheck=".." .
|
|
For example, a simple form just supporting entry of a name and a date would look as follows: |
|
Name |
Type |
Size |
Values |
Tooltip message |
Attributes |
|
|
< < | Many types of form fields are available. Some are TWiki internal, some are provided by extensions. Find more TWiki form field extensions on TWiki.org. The Size and Value depend on the Type used. Form field types: |
> > | Many types of form fields are available. Some are TWiki internal, some are provided by extensions. Find more TWiki form field extensions on TWiki.org. The Size , Value and Attributes depend on the Type used. Form field types: |
|
|
|
select+multi+values |
Combination of select+multi and select+values |
color |
Single-line text box and a color picker to pick a color. The color can also be typed into the text box, such as #123456 . An attribute of type="popup" shows a button that, when clicked, opens a color picker popup. See details. |
Text box width in number of characters |
Initial (default) color |
date |
Text input field and a button next to it to pick a date from a pop-up calendar. The date can also be typed into the text box. See details. |
Text box width in number of characters |
Initial (default) date |
|
|
> > | Note on Attributes:
- Common attributes: hidden, mandatory, class, form, onblur, onfocus, onchange, onselect, onmouseover, onmouseout, spellcheck, style, tabindex, title, translate
- Type-specific attributes:
-
text type: id, max, maxlength, min, pattern, placeholder
-
textarea type: autocomplete, id, maxlength, minlength, pattern, placeholder, wrap
-
label type: id, max, maxlength, min
-
combobox type: max, maxlength, min, pattern, placeholder
|
| Values in Other Topics
As described above, you can also retrieve possible values for select, checkbox or radio types from other topics. For example, if you have a rows defined like this: |