none
authorMikeMannix <MikeMannix>
Sat, 5 Jan 2002 21:30:00 +0000 (21:30 +0000)
committerMikeMannix <MikeMannix>
Sat, 5 Jan 2002 21:30:00 +0000 (21:30 +0000)
TWiki/TWikiForms.mdwn

index b460a26..e3ebfb2 100644 (file)
@@ -15,7 +15,8 @@
         <li><a href="#Enabling Forms by Web"> Enabling Forms by Web</a></li>
         <li><a href="#Including Forms in New Topics"> Including Forms in New Topics</a></li>
         <li><a href="#Setting Up Multiple Form Options"> Setting Up Multiple Form Options</a></li>
-        <li><a href="#Form Template Data Storage"> Form Template Data Storage</a></li>
+        <li><a href="#Form Data Storage"> Form Data Storage</a></li>
+        <li><a href="#Using Form Data"> Using Form Data</a></li>
       </ul>
     </li>
   </ul>
 
 # <a name="TWiki Forms"></a> TWiki Forms
 
-_Form-based input in topics, with name/value pairs stored as Meta Data variables; multiple forms per web &amp; topic_
+_Form-based input in topics, with name/value pairs stored as Meta Data variables; choose one of multiple forms per web &amp; topic_
 
 ## <a name="Overview"></a> Overview
 
-By adding form-based input to free-form content, you can structure topics with unlimited, easily searchable categories. When forms are enabled for a web and selected in a topic, the form appears in edit mode, and the contents are rendered as a table when viewing the actual page. When editing, can switch forms, if more than one is defined, or remove forms entirely. Form input values are stored as [[TWikiMetaData]]; all data is saved.
+By adding form-based input to freeform content, you can structure topics with unlimited, easily searchable categories. When forms are enabled for a web and selected in a topic, a single form appears in edit mode, and the contents are rendered as a table when viewed on the display page. You can define unlimited forms per web. For each topic, you can select a template if more than one is defined, or remove forms entirely. Form input values are stored as [[TWikiMetaData]]; all data is saved.
 
-Form Templates replace TWikiCategory Tables from the 01-Dec-2000 version of TWiki.
+Form Templates replace TWikiCategoryTables from the 01-Dec-2000 version of TWiki.
 
 <a name="FormsVsCategoryTables"></a>
 
@@ -66,18 +67,18 @@ On upgrading from the previous TWiki, a Form Template topic has to be built for
 
 The new Form Template system should work with old Category Table data with no special conversion. Data is assigned to Meta variables the first time an imported topic is edited and saved in the new system.
 
-**_NOTE:_** If things aren't working correctly, there may be useful entries in `data/warning.txt`.
+%T% **NOTE:** If things aren't working correctly, there may be useful entries in `data/warning.txt`.
 
 ## <a name="Defining a Form Template"></a> Defining a Form Template
 
-A Form Template is simply a page containing your form, defined in a table where each row is one form field.
+A Form Template is simply a page containing your form, defined as a table where each row is one form field.
 
 ### <a name="Form Template Elements"></a> Form Template Elements
 
 - **form template** - a set of fields defining a form (replaces _category table definition_)
-  - A web can use one or more form templates.
-- **form** - A topic containing additional meta-data (besides the free form TEXTAREA) which categorizes the content. (replaces _category table_)
-  - A topic has zero or one of the defined forms. So there are topics with a form or without.
+  - A web can use one or more form templates
+- **form** - a topic containing additional meta data (besides the freeform TEXTAREA) that categorizes the content (replaces _category table_)
+  - Within a form-enabled web, individual topics can have a form or no form
 - **form field** - a named item in a form (replaces _category item name_)
 - **field type** - selects the INPUT type:
   - **select** - drop-down menu or scrollable box
@@ -90,12 +91,14 @@ A Form Template is simply a page containing your form, defined in a table where
 
 ### <a name="Defining a Form in One Topic"></a> Defining a Form in One Topic
 
-1. Create a new topic with your Form name: MyForm, ExpenseReport, InfoCategory, RecordReview, whatever you need.
-2. Create a TWiki table, with each column representing one element of an entry field: Name, Type, Size, Values, and Tooltip msessage (see sample below).
+1. Create a new topic with your form name: <code>**YourForm**</code>, <code>**ExpenseReport**</code>, <code>**InfoCategory**</code>, <code>**RecordReview**</code>, whatever you need.
+2. Create a TWiki table, with each column head representing one element of an entry field: <code>**Name**</code>, <code>**Type**</code>, <code>**Size**</code>, <code>**Values**</code>, and <code>**Tooltip msessage**</code> _(see sample below)_.
 3. For each field, fill in a new line; for the type of field, select from the list.
-4. Save the topic.
+4. Save the topic _(you can later choose to [[enable/disable|Main/WebHome#EnablingForms]] individual forms)_.
 
-> **Example: WebForm from the TWiki.Know web**
+> **Example:**
+>
+> <code>**WebForm**</code>
 >
 >     | *Name* | *Type* | *Size* | *Values* | *Tooltip message* |
 >     | Know.TopicClassification | select | 1 | Know.NoDisclosure,
@@ -137,14 +140,14 @@ A Form Template is simply a page containing your form, defined in a table where
 
 ### <a name="Defining a Form with Multiple To"></a> Defining a Form with Multiple Topics
 
-The Form Template can also be defined in an alternative way by using more then one topic:
+Forms can also be defined by using form templates that retrieve field values from one or more separate topics:
 
-- A Form Template topic defines the Form.
-- Fields that have more then one value - radio, select, checkbox - can be defined in individual field value topics.
+- A <code>**FormTemplate**</code> topic defines the Form, ex: <code>**YourFormTemplate**</code>.
+- For each field that has a value list - select, radio, checkbox - can use separate topic to define the available values.
 
 > **Example: WebFormTemplate**
 >
-> - Know.WebFormTemplate Form main definition: <br />   <table border="1" cellpadding="0" cellspacing="0">
+> - Know.WebFormTemplate main definition: <br />   <table border="1" cellpadding="0" cellspacing="0">
 >   <tr>
 >     <th bgcolor="#99CCCC"><strong> Name </strong></th>
 >     <th bgcolor="#99CCCC"><strong> Type </strong></th>
@@ -156,24 +159,25 @@ The Form Template can also be defined in an alternative way by using more then o
 >     <td>[[Know/TopicClassification]]</td>
 >     <td> select </td>
 >     <td> 1 </td>
->     <td align="center"> ... </td>
+>     <td>   </td>
 >     <td> blah blah... </td>
 >   </tr>
 >   <tr>
 >     <td>[[Know/OperatingSystem]]</td>
 >     <td> checkbox </td>
 >     <td> 3 </td>
->     <td align="center"> ... </td>
+>     <td>   </td>
 >     <td> blah blah... </td>
 >   </tr>
 >   <tr>
 >     <td>[[Know/OsVersion]]</td>
 >     <td> text </td>
 >     <td> 16 </td>
->     <td align="center"> ... </td>
+>     <td>   </td>
 >     <td> blah blah... </td>
 >   </tr>
 > </table>
+> <br /> %X% Leave the <code>**Values**</code> field **blank**.
 >
 > - Know.TopicClassification field value definition: <br />   <table border="1" cellpadding="0" cellspacing="0">
 >   <tr>
@@ -199,46 +203,54 @@ The Form Template can also be defined in an alternative way by using more then o
 > </table>
 
 - **Implementation Notes:** This format allows you to define field items with or without [[WikiNames]], depending on your needs.
-  - The topic can be protected in the usual manner so that not everybody can change the form template - see [[TWikiAccessControl]]
-  - `[[...]]` links can be used for force a link, at present `[[...][...]]` format is not supported.
-  - The "Tooltip message" column is used as a tool tip for the field name (only if field name is a [[WikiName]]) - you only see the tooltip on edit.
-  - The first item in the list is the default item. Alternative initial values can be given in a topic template such as `WebTopicEditTemplate` or using field=value or for checkboxes field=1.
+  - Topics can be protected in the usual manner, using [[TWikiAccessControl]], to limit who can change the form template and/or individual value lists.
+  - <code>**\[[...]]**</code> links can be used to force a link (at present, the <code>**\[[...]\[...]]**</code> format is not supported).
+  - The <code>**Tooltip message**</code> column is used as a tooltip for the field name (only if field name is a [[WikiName]]) - you only see the tooltip In edit.
+  - The first item in the list is the default item. Alternative initial values can be set in a topic template, like <code>**WebTopicEditTemplate**</code>, with <code>**field=value**</code>, or, for checkboxes, <code>**field=1**</code>.
   - The topic definition is not read when a topic is viewed.
 
+<a name="EnablingForms"></a>
+
 ## <a name="Enabling Forms by Web"></a> Enabling Forms by Web
 
-Forms are enabled on a per web basis. The <code>**WEBFORMS**</code> variable in [[WebPreferences]] is optional and defines a list of possible Form Templates. Example:
+Forms are enabled on a per web basis. The <code>**WEBFORMS**</code> variable in [[WebPreferences]] is optional and defines a list of possible form templates. Example:
 
 - Set WEBFORMS = BugForm, FeatureForm, BookLoanForm
 
-- With `WEBFORMS` enabled, an extra button is added to the edit view. If the topic doesn't have a Form, an **Add Form** button appears at the end of the topic. If a Form is present, a **Change** button appears in the top row of the Form. The buttons open a screen that enables selection of a form specified in `WEBFORMS`, or the **No form** option.
+- With <code>**WEBFORMS**</code> enabled, an extra button is added to the edit view. If the topic doesn't have a Form, an **Add Form** button appears at the end of the topic. If a Form is present, a **Change** button appears in the top row of the Form. The buttons open a screen that enables selection of a form specified in `WEBFORMS`, or the **No form** option.
 
 - A default Form Template (new topics get this default form) can be provided by creating the `WebTopicEditTemplate` topic in a web and adding a form to it. Initial Form values can be set there.
 
 - Additionally a new topic can be given a Form using the `formtemplate` parameter in the URL. Initial values can then be provided in the URLs or as form values:
-  - other than checkboxes: `name`, ex: `?BugPriority=1`
-  - checkbox: `namevalue=1`, ex: `?ColourRed=1`. <br /> Boxes with a tick must be specified.
+  - other than checkboxes: <code>**name**</code>, ex: <code>**?BugPriority=1**</code>
+  - checkbox: <code>**namevalue=1**</code>, ex: <code>**?ColourRed=1**</code>. <br /> Boxes with a tick must be specified.
 
 ## <a name="Including Forms in New Topics"></a> Including Forms in New Topics
 
-When you create a new topic in a web that has the WEBFORMS Preferences variable set, an **Add Form** button appears at the bottom of the page. You can start all new topics with forms enabled, and pre-select a form if there's more than one available:
+When you create a new topic in a web that has the <code>**WEBFORMS**</code> Preferences variable set, an **Add Form** button appears at the bottom of the page. You can start all new topics with forms enabled, and pre-select a form if there's more than one available:
 
 1. **Edit** the [[WebTopicEditTemplate]] topic, adding the name of an available Form.
 2. **Create** a new topic to check - the Form should appear with values set.
   - Click **Change** to switch or remove Forms.
 
-A form embedded in a topic also appears in a new topic. This is done by specifying the `formtemplate` parameter in the URL.
+A form embedded in a topic also appears in a new topic. This is done by specifying the <code>**formtemplate**</code> parameter in the URL.
 
 ## <a name="Setting Up Multiple Form Options"></a> Setting Up Multiple Form Options
 
-- The optional <code>**WEBFORMS**</code> variable defines alternative Form Templates that can be selected by pressing **Change** in edit mode.
+- The optional <code>**WEBFORMS**</code> variable defines alternative forms that can be selected by pressing **Change** in edit mode.
+
+- A topic template can use any form.
+
+- New topics with a form are created by simple HTML forms asking for a topic name. For example, you can have a `SubmitExpenseReport` topic where you can create new expense reports, a `SubmitVacationRequest` topic, and so on. These can specify the required template topic with its associated form.
+
+## <a name="Form Data Storage"></a> Form Data Storage
 
-- A Template topic can use any Form Template.
+The form topic name, fields and values are stored as [[TWikiMetaData]] - the order of the field/value pairs is the same as in the template.
 
-- New topics with a Form are created by simple HTML forms asking for a topic name. For example, you can have a `SubmitExpenseReport` topic where you can create new expense reports - a `SubmitVacationRequest` topic and so on. These can specify the required template topic with its associated Form.
+<a name="UsingFormData"></a>
 
-## <a name="Form Template Data Storage"></a> Form Template Data Storage
+## <a name="Using Form Data"></a> Using Form Data
 
-The Form Template topic name, fields and values are stored as [[TWikiMetaData]]. The order of field/value pairs in the Meta Data is the same as in the Template.
+[[TWikiForms]] accept user-input data, stored as [[TWikiMetaData]]. Meta data also contains program-generated info about changes, attachments, etc. To find, format and display form and other meta data, see [[TWikiMetaData]], <code>**SEARCH**</code> and <code>**METASEARCH**</code> variables in [[TWikiVariables]], and [[TWiki Formatted Search|Main/FormattedSearch]] for various options.
 
--- [[JohnTalintyre]] - 16 Aug 2001 <br /> -- [[MikeMannix]] - 03 Dec 2001
+-- [[JohnTalintyre]] - 16 Aug 2001 <br /> -- [[MikeMannix]] - 05 Jan 2002