Template documentationedit documentation
Use this template to create forms that add content to pages. Forms can contain up to 20 fields.
Parameters[edit source]
page
— Name of the page where the form will post the data. If the page doesn't exist, it will be created. If the page exists, the data will be appended. If omitted, the current page will be used.section
— Name of the section where the form will post the data. If the section doesn't exist, it will be created. If the section exists, the data will be appended. If omitted, the data will be appended to the end of the page.template
— Required. Name of the template that the form will use to process and format the data. If you don't want to use a template (or if you want to use several templates) then you can create a template meant to be substituted and setsubst:Your template
as the value of this parameter (example).fieldN
(replacing N for a number from 1 to 20) — Name of the field. This will be the name of the parameter fed to the template, so use lowercase and dashes to follow current template conventions (e.g.field1 = access-date
). If you want to use anonymous parameters, just name them using numbers (e.g.field1 = 1
).fieldN-type
— Type of the field. Supported values are:text
— This is the normal, default field type. Use it for plain text inputs.textarea
— Use it for multi-line text inputs.location
— Use it for location inputs with autocomplete feature.boolean
— Use it for yes-no inputs.stars
— Use it for star rating inputs.hidden
— Hides the input and label. Use it for hidden inputs.section
— Hides the input but not the label. Use it to create section titles and other breaks in your form.
fieldN-label
— Label of the field.fieldN-placeholder
— Placeholder of the field.fieldN-required
— Wether the field is required. Any value means yes.fieldN-value
— Default value of the field.fieldN-style
— Extra CSS of the field.send
— Text of the Submit button. Default is "Send".sending
— Text to show while the data is being sent. Default is "Sending...".sent
— Text to show when the data is sent. Default is "Sent, thanks!".class
— Extra CSS class of the form.style
— Extra CSS styling of the form.id
— ID of the form. Useful for linking to it.
Examples[edit source]
Simple[edit source]
{{Form | field1 = student | field1-label = Are you a student? | field1-type = boolean | field2 = name | field2-label = What's your name? }}
Advanced[edit source]
{{Form | field1 = section1 | field1-type = section | field1-label = '''Basic data''' | field2 = student | field2-label = Are you a student? | field2-type = boolean | field3 = name | field3-label = What's your name? | field4 = city | field4-type = location | field4-label = What city are you from? | field5 = section2 | field5-type = section | field5-label = '''Course data''' | field6 = course | field6-label = What course are you in? }}
See also[edit source]
- Category:Form templates - Templates that use this meta template
- MediaWiki:TemplateForm.js - JavaScript of this template
- Template:Form/styles.css - CSS of this template
Template data[edit source]
Use this template to create forms that add content to pages.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Template | template | Name of the template that this form will use
| Template | required |
Page | page | Name of the page that this form will edit
| Page name | optional |
Section | section | Name of the section that this form will edit
| String | optional |
Field 1 | field1 | Name of the first field | String | optional |
Field 1 type | field1-type | Field type
| String | optional |
Field 1 required | field1-required | Is the field required?
| Boolean | optional |
Field 1 label | field1-label | Label of the field | String | optional |
Field 1 placeholder | field1-placeholder | Placeholder of the field | String | optional |
Filed 1 value | field1-value | Default value of the field | String | optional |
Field 2 | field2 | Name of the first field | String | optional |
Field 2 type | field2-type | Field type
| String | optional |
Field 2 required | field2-required | Is the field required?
| Boolean | optional |
Field 2 label | field2-label | Label of the field | String | optional |
Field 2 placeholder | field2-placeholder | Placeholder of the field | String | optional |
Filed 2 value | field2-value | Default value of the field | String | optional |
Field 3 | field3 | Name of the first field | String | optional |
Field 3 type | field3-type | Field type
| String | optional |
Field 3 required | field3-required | Is the field required?
| Boolean | optional |
Field 3 label | field3-label | Label of the field | String | optional |
Field 3 placeholder | field3-placeholder | Placeholder of the field | String | optional |
Filed 3 value | field3-value | Default value of the field | String | optional |
Field 4 | field4 | Name of the first field | String | optional |
Field 4 type | field4-type | Field type
| String | optional |
Field 4 required | field4-required | Is the field required?
| Boolean | optional |
Field 4 label | field4-label | Label of the field | String | optional |
Field 4 placeholder | field4-placeholder | Placeholder of the field | String | optional |
Filed 4 value | field4-value | Default value of the field | String | optional |
Field 5 | field5 | Name of the first field | String | optional |
Field 5 type | field5-type | Field type
| String | optional |
Field 5 required | field5-required | Is the field required?
| Boolean | optional |
Field 5 label | field5-label | Label of the field | String | optional |
Field 5 placeholder | field5-placeholder | Placeholder of the field | String | optional |
Filed 5 value | field5-value | Default value of the field | String | optional |
Field 6 | field6 | Name of the first field | String | optional |
Field 6 type | field6-type | Field type
| String | optional |
Field 6 required | field6-required | Is the field required?
| Boolean | optional |
Field 6 label | field6-label | Label of the field | String | optional |
Field 6 placeholder | field6-placeholder | Placeholder of the field | String | optional |
Filed 6 value | field6-value | Default value of the field | String | optional |
Field 7 | field7 | Name of the first field | String | optional |
Field 7 type | field7-type | Field type
| String | optional |
Field 7 required | field7-required | Is the field required?
| Boolean | optional |
Field 7 label | field7-label | Label of the field | String | optional |
Field 7 placeholder | field7-placeholder | Placeholder of the field | String | optional |
Filed 7 value | field7-value | Default value of the field | String | optional |
Field 8 | field8 | Name of the first field | String | optional |
Field 8 type | field8-type | Field type
| String | optional |
Field 8 required | field8-required | Is the field required?
| Boolean | optional |
Field 8 label | field8-label | Label of the field | String | optional |
Field 8 placeholder | field8-placeholder | Placeholder of the field | String | optional |
Filed 8 value | field8-value | Default value of the field | String | optional |
Field 9 | field9 | Name of the first field | String | optional |
Field 9 type | field9-type | Field type
| String | optional |
Field 9 required | field9-required | Is the field required?
| Boolean | optional |
Field 9 label | field9-label | Label of the field | String | optional |
Field 9 placeholder | field9-placeholder | Placeholder of the field | String | optional |
Filed 9 value | field9-value | Default value of the field | String | optional |
Send | send | Label of the Submit button
| String | optional |
Sending | sending | Message when the data is being sent
| String | optional |
Sent | sent | Message when the data is sent
| String | optional |
Class | class | Extra CSS class of the form
| String | optional |
Style | style | Extra CSS styling of the form
| String | optional |
ID | id | ID of the form
| Unknown | optional |