%EDITFORMFIELD{"fieldname" form="...Form"}%
- create form field defined in a TWiki Form template
%EDITFORMFIELD{"fieldname" topic="..."}%
- create form field based on a topic that has a TWiki Form & initialize its value
%EDITFORMFIELD{"fieldname" type="..."}%
- create an HTML input field
Parameter:![]() | Description: | Default: |
---|---|---|
value="..." | Initial value of input field. If omitted and if topic="..." is specified, the value is taken from the named form field. | "" |
type="start" | Special case: Start an HTML form. Parameters: "form" type="start" action="save" topic="..." method="" onsubmit="" onreset="" รข\x{fffd}ยข action : Specify a TWiki script (view , edit , save , ...), or a full action URL, default "view" . รข\x{fffd}ยข topic : Specify topic name or Web.TopicName , default current topic; ignored if full action URL is provided. รข\x{fffd}ยข method : HTML form action method, default "post" for save action, else "get" . รข\x{fffd}ยข onsubmit : Execute JavaScript when the form is submitted, optional. รข\x{fffd}ยข onreset : Execute JavaScript when the reset button is clicked, optional. | "" |
type="end" | Special case: End an HTML form. Parameters: "form" type="end" | "" |
type="..." | Special case: Create an input field regardless of the type defined in the TWikiForm. Used mainly for hidden fields and submit button. The nameless parameter is the field name. Supported types: รข\x{fffd}ยข "fieldname" type="hidden" value="..." - hidden input field. รข\x{fffd}ยข "fieldname" type="submit" value="..." - submit button, value is button label. รข\x{fffd}ยข "fieldname" type="button" value="..." onclick="..." - regular button, value is button label. รข\x{fffd}ยข "fieldname" type="text" value="..." size="80" - text input field. รข\x{fffd}ยข "fieldname" type="textarea" value="..." size="80x6" - multi line text area field, size denotes columns x rows. รข\x{fffd}ยข "fieldname" type="checkbox" value="..." text="..." - checkbox, text is display text. รข\x{fffd}ยข "fieldname" type="radio" value="..." text="..." - radio button, text is display text. รข\x{fffd}ยข In addition, any valid XHML and HTML5 input type is supported, such as type="date" , type="file" , type="image" . Additional type-specific parameters can be supplied, such as alt="..." , checked="checked" , class="..." , max="..." , min="..." , placeholder="..." , src="..." , style="..." , width="..." . Consult HTML documentation. | "" |
topic="..." | Name of topic containing form, such as "Bug1234" . Specify topic name or Web.TopicName | Either form or topic is required unless type is specified |
format="..." | Format string. Supported variables: รข\x{fffd}ยข $inputfield - rendered form input field. รข\x{fffd}ยข $title - raw field name (includes space and other special characters). รข\x{fffd}ยข $name - field name (sanitized title). รข\x{fffd}ยข $size - size of field or selector. รข\x{fffd}ยข $value - initial value, or select options. รข\x{fffd}ยข $tooltip - tooltip message. รข\x{fffd}ยข $attributes - type attributes, such as H for hidden, M for mandatory. รข\x{fffd}ยข $extra - extra information, such as * for mandatory field. See details in TWikiForms#FormFieldTypes. This parameter is ignored if type="..." is specified. | "$inputfield" |
form="..." | Name of form template topic, such as "BugForm" . Specify topic name or Web.TopicName | Either form or topic is required unless type is specified |
"fieldname" | The name of a TWiki form field or HTML form field. | Required |
%EDITFORMFIELD{ "ReleaseType" form="PackageForm" value="Beta-1" }%
%EDITFORMFIELD{ "form" type="start" action="save" topic="%BASEWEB%.%BASETOPIC%" method="post" }%
| Priority: | %EDITFORMFIELD{ "Priority" topic="%BASETOPIC%" }% |
| Status: | %EDITFORMFIELD{ "Status" topic="%BASETOPIC%" }% |
| | %EDITFORMFIELD{ "form" type="submit" value="Update" }% |
%EDITFORMFIELD{ "Updated" type="hidden" value="%SERVERTIME{$year-$mo-$day}%" }%
%EDITFORMFIELD{ "form" type="end" }%