%META:TOPICINFO{author="TWikiContributor" date="1402462881" format="1.1" version="1"}%
%META:TOPICPARENT{name="TWikiVariables"}%
#VarFORM
---+++ FORM{} -- render a TWiki form for view
   * Show a table containing data of a [[TWikiForms][TWiki form]] attached to a topic
   * Syntax: =%<nop>FORM{topic="..." formfields="..." ...}%=
   * Supported parameters:
     | *Parameter:* | *Description:* | *Default:* |
     | ="..."= or%BR% =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 ="%VBAR%  <nop>*[<nop>[$formweb.$formtopic][$formtopic]]*<nop>  %VBAR%%VBAR%"= is used. If ="none"=, the header is suppressed. Supported variables: %BB% =$formweb= - name of web containing the form definition. %BB% =$formtopic= - name of topic containing the form definition. | ="on"= |
     | =format="..."= | Format of one form field. Supported variables: %BB% =$title= - raw field name (includes space and other special characters). %BB% =$name= - field name (sanitized title). %BB% =$type= - form field type. %BB% =$size= - size of field or selector. %BB% =$value= - form field value. %BB% =$value(<i>20, -&lt;br /&gt;</i>)= - value hyphenated every 20 characters using separator <tt>-&lt;br /&gt;</tt>. %BB% =$value(<i>30, ...</i>)= - value shortened to 30 characters. %BB% =$length= - length of form field value. %BB% =$tooltip= - tooltip message. %BB% =$attributes= - type attributes, such as H for hidden, M for mandatory. %BB% =$formweb= - name of web containing the form definition. %BB% =$formtopic= - name of topic containing the form definition. %BR% See details in TWikiForms#FormFieldTypes. | ="%VBAR% $title: %VBAR% $value %VBAR%"= |
     | =separator="..."= | Line separator. Variable =$br= expands to =&lt;br /&gt;= 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 =&lt;br /&gt;= 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 [[%IF{"'%INCLUDINGTOPIC%'='TWikiVariables'" then="#"}%VarENCODE][ENCODE]] for details. | =""= (no encoding) |
     | =showhidden="..."= | Set to ="on"= to show also hidden form fields. | =""= |
   * Examples:
      * =%<nop>FORM{topic="%<nop>INCLUDINGTOPIC%"}%= - show form data of the including topic (typically used in an included header)
      * =%<nop>FORM{topic="Projects.<nop>SushiProject" formfields="Title, Status, Deadline" header="none"}%= - show a subset of form fields
      * =%<nop>FORM{format="$name" header="none" separator=", "}%= - get all visible form field names as a list
   * Category: DatabaseAndFormsVariables, DevelopmentVariables, FormattingAndRenderingVariables
   * Related: [[%IF{"'%INCLUDINGTOPIC%'='TWikiVariables'" then="#"}%VarEDITFORM][EDITFORM]], [[%IF{"'%INCLUDINGTOPIC%'='TWikiVariables'" then="#"}%VarEDITFORMFIELD][EDITFORMFIELD]], [[%IF{"'%INCLUDINGTOPIC%'='TWikiVariables'" then="#"}%VarENCODE][ENCODE]], [[%IF{"'%INCLUDINGTOPIC%'='TWikiVariables'" then="#"}%VarENTITY][ENTITY]], [[%IF{"'%INCLUDINGTOPIC%'='TWikiVariables'" then="#"}%VarFORMFIELD][FORMFIELD]], [[%IF{"'%INCLUDINGTOPIC%'='TWikiVariables'" then="#"}%VarMETA][META]], [[%IF{"'%INCLUDINGTOPIC%'='TWikiVariables'" then="#"}%VarMETASEARCH][METASEARCH]], [[%IF{"'%INCLUDINGTOPIC%'='TWikiVariables'" then="#"}%VarSEARCH][SEARCH]], TWikiForms, FormattedSearch, QuerySearch, SearchHelp
