FORM{} -- render a TWiki form for view

  • Show a table containing data of a TWiki form attached to a topic
  • Syntax: %FORM{topic="..." formfields="..." ...}%
  • Supported parameters:
    Parameter:Sorted descending Description: Default:
    showhidden="..." Set to "on" to show also hidden form fields. ""
    separator="..." Line separator. Variable $br expands to <br /> tag, and $n to a newline. "$n"
    rev="..." Get the form from the specified topic revision, range "1" to top revision of topic. "0" is equivalent to the top revision The rev URL parameter value if present, else the top revision
    newline="$br" Convert newlines in textarea to other delimiters. Variable $br expands to <br /> tag, and $n to a newline. Other text is encoded based on encode parameter. "$br" if format is a TWiki table, else "\n"
    header="..." Form header, typically containing the form name. If "on", the default format "|  *[[$formweb.$formtopic][$formtopic]]*  ||" is used. If "none", the header is suppressed. Supported variables:
    $formweb - name of web containing the form definition.
    $formtopic - name of topic containing the form definition.
    formfields="..., ..." Specify names of TWiki form fields to show, in sequence. The all token shows all remaining fields. "all"
    format="..." Format of one form field. Supported variables:
    $title - raw field name (includes space and other special characters).
    $name - field name (sanitized title).
    $type - form field type.
    $size - size of field or selector.
    $value - form field value.
    $value(20, -<br />) - value hyphenated every 20 characters using separator -<br />.
    $value(30, ...) - value shortened to 30 characters.
    $length - length of form field value.
    $tooltip - tooltip message.
    $attributes - type attributes, such as H for hidden, M for mandatory.
    $formweb - name of web containing the form definition.
    $formtopic - name of topic containing the form definition.
    See details in TWikiForms#FormFieldTypes.
    "| $title: | $value |"
    encode="html" Encode special characters in form field value into HTML entities. Additional encodings available: encode="quote", encode="moderate", encode="safe", encode="entity" and encode="url". See ENCODE for details. "" (no encoding)
    default="..." Text shown when no form or form fields are found ""
    "..." or
    Name of topic containing the TWiki form, such as "Bug1234". Specify topic name or Web.TopicName Current topic
  • Examples:
    • %FORM{topic="%INCLUDINGTOPIC%"}% - show form data of the including topic (typically used in an included header)
    • %FORM{topic="Projects.SushiProject" formfields="Title, Status, Deadline" header="none"}% - show a subset of form fields
    • %FORM{format="$name" header="none" separator=", "}% - get all visible form field names as a list
  • Category: DatabaseAndFormsVariables, DevelopmentVariables, FormattingAndRenderingVariables

This topic: TWiki > WebHome > TWikiVariables > VarFORM
Topic revision: r1 - 11 Jun 2014 - TWikiContributor
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback
Note: Please contribute updates to this topic on at TWiki:TWiki.VarFORM.