Created page with "The '''Forms''' extension allows formatting a wiki page or a user dialog as a form. It is also used in conjunction with the Workflows extension where it provides input forms for workflow data. ==Introduction== To create a checklist as a form, for example, the following steps are necessary: # '''Create the checklist form.''' # '''Create checklist instances.''' Optionally, the styling of the form can be adjusted. As an example, we are creating..." |
No edit summary |
||
| Line 1: | Line 1: | ||
== Form elements == | == Form elements == | ||
It is possible to add the following form fields to your form: | It is possible to add the following form fields to your form: | ||
| Line 353: | Line 324: | ||
|calls a function when the event occurs; | |calls a function when the event occurs; | ||
see the [[Manual:Extension/Forms/Progress bar|progress bar]] example. | see the [[Manual:Extension/Forms/Progress bar|progress bar]] example. | ||
|} | |}{{translation}} | ||
__FORCETOC__ | |||
{{ | |||
Latest revision as of 14:34, 20 May 2026
Form elements[edit | edit source]
It is possible to add the following form fields to your form:
Inputs[edit | edit source]
| Field | Functionality |
|---|---|
| Book | auto-complete field that finds pages in the namespace "Book" |
| Text | standard text field |
| Textarea | multi-line text field |
| Wikitext input | multi-line text field that expects Wikitext syntax |
| Category multiselect | token field to add one or more categories to the page; values are separated with the enter-key
|
| Checkbox | single checkbox |
| Menu tag multiselect | multiple-value input; values are separated with the enter-key
|
| Checkbox multiselect | checkbox group (allows selecting multiple values in the group) |
| Dropdown | dropdown list with predefined options |
| Number | integer field |
| Radio button | single radio button (usually not used in a manually completed form) |
| Radio group | radio buttons for toggling a selection (allows selecting only one value in the group) |
| File chooser | selects a file in the wiki |
| Title input | auto-complete field for wiki pages |
| Combo box | combines a text input field and a dropdown list. Users can select a predefined value or type their own. |
| Password input | sets a password with a password and password-repeat field. This is not used in forms for the target types JSON on wikipage, Template or Email, as the password is stored in plain text.
|
| Tag input | token field to add multiple values; values are separated with the enter-key
|
| Date | same as Date picker |
| Title input | selects page titles in the wiki |
| User input | username that exists in the wiki |
| Group input | group name that exists in the wiki |
| Group multiselect | multiple group names |
| User multiselect | multiple user names |
| Title multiseslect | multiple page titles |
| Date picker | calendar widget |
| Percent | integer value |
Other[edit | edit source]
| Element | Description |
|---|---|
| Static Wikitext | non-editable text |
| Button | triggers an action (requires a defined event listener) |
| Message banner | message that can be shown anywhere in the form;
the type that is set (notice, error, warning, success) provides the visual formatting |
| Partial form import | adds form fields from another form |
| Icon | - |
| Indicator | - |
| Label | - |
| Progress bar | visual representation of the number of completed steps in a form such as a checklist |
| Section label | a heading to a form section |
| HR | a visual separator line |
Input field options[edit | edit source]
Each input field has a combination of any of these options:
| Type | Field | Functionality |
|---|---|---|
| (all) | Name | field name stored in the database (avoid special characters) |
| Label | text label shown to users | |
| Help | creates a tooltip pop-up next to the label | |
| No layout | hides the label | |
| Show on | mode in which this field is visible | |
| Editable on | sets when the field value can be edited | |
| Book | Return property | ? |
| Type | Field | Functionality |
|---|---|---|
| (all) | CSS Classes | add individual CSS-classes for use on MediaWiki:Common.css
- the class is set on the form field itself and does not include the label; multiple classes can be set together or you can add them separately |
| Style | define an inline style that affects only this field. The style is applied to the wrapper and includes the label and the field | |
| Textarea, Wikitext input | Number of rows | used for textareas |
| Placeholder | text that is displayed before the user is typing a value (has no effect, if there is also a default value set) | |
| Radio group | No default value | ensures that there is no pre-selected radio-button if a default would not make sense |
| Radio group, Checkbox multiselect | Horizontal layout | aligns multiselect checkboxes or radio groups horizontally |
| Button | Icon | displays an icon before the text, (e.g. a bootstrap-icon like bi bi-calendar)
|
| Indicator | displays an icon after the text (e.g. a bootstrap-icon like bi bi-arrow-right)
| |
| Framed | when deactivated, the button looks like text only (and can be styled via CSS classes, e.g. btn button-warning)
|
| Type | Fieldset | Field | Functionality |
|---|---|---|---|
| (all) | Custom widget properties | Key | |
| Value | |||
| Listeners | Event | event that is supported by OO.ui widgets, such as change, enter, focus, blur | |
| Callback | function that is called when the event occurs (can be declared in MediaWiki:Common.js for example | ||
| Default value /
Selected by default |
value that is used if the user does not provide a value; field type "checkbox" has option "Selected by default" instead | ||
| Required | form cannot be submitted without this field having a value | ||
| Password | Password strength | weak:
medium: strong: | |
| Tag | Input position | inline:
outline: | |
| Allow arbitrary | It is possible to add values other than the allowed values (only necessary if allowed values are defined) |
Form Settings[edit | edit source]
Appearance[edit | edit source]
| Field | Functionality |
|---|---|
| Title | display title for the form |
| Display title | shows the form title above each form instance |
| Display form name | displays the name fo the form with label Form used as first form element |
Behaviour[edit | edit source]
| Field | Functionality |
|---|---|
| Categories | adds categories to each form instance; values are separated with the enter-key
|
| Seal after creation | form instances cannot be edited after the initial save |
| Enable intermediate saving | form instances show both a Save end a Save & Close button;
the |
Infrastructure[edit | edit source]
| Field | Functionality |
|---|---|
| Resource loader dependencies | |
| Keep track of revisions | |
| Includable | extends form |
| Abstract | |
| Partial |
Target[edit | edit source]
| Field | Functionality |
|---|---|
| Target type | |
| Predefined page title for pages created using this form | use the field name to insert the value from a form field;
for example: if you have a field with the name |
Listeners[edit | edit source]
| Field | Functionality |
|---|---|
| Event | each listener reacts to one of these events:
|
| Callback | calls a function when the event occurs;
see the progress bar example. |