Tags:
create new tag
view all tags
ALERT! NOTE: This is a DistributionDocument.
  • Please help maintain high quality documentation: This is a wiki, please fix the documentation if you find errors or incomplete content.
  • Put questions and suggestions concerning the documentation of this topic in the comments section below.
  • Use the Support web for problems you are having using TWiki.
  • Use the Sandbox web to evaluate & test TWiki.

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: Description: Default:
    "..." or
    topic="..."
    Name of topic containing the TWiki form, such as "Bug1234". Specify topic name or Web.TopicName Current topic
    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
    formfields="..., ..." Specify names of TWiki form fields to show, in sequence. The all token shows all remaining fields. "all"
    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.
    "on"
    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.
    "| $title: | $value |"
    separator="..." Line separator. Variable $br expands to <br /> tag, and $n to a newline. "$n"
    default="..." Text shown when no form or form fields are found ""
    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"
    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)
    showhidden="..." Set to "on" to show also hidden form fields. ""
  • 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
  • Related: EDITFORM, EDITFORMFIELD, ENCODE, ENTITY, FORMFIELD, META, METASEARCH, SEARCH, TWikiForms, FormattedSearch, QuerySearch, SearchHelp



Comments & Questions about this Distribution Document Topic

Please use the Support forum if you have questions about TWiki features. This comment section is about the documentation of this topic.
Topic revision: r1 - 2014-12-16 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.