From eecf58c5a84001c53550543887cc90e41909588e Mon Sep 17 00:00:00 2001 From: MikeMannix Date: Sun, 9 Sep 2001 06:51:31 +0000 Subject: none --- TWiki/TWikiForms.mdwn | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'TWiki') diff --git a/TWiki/TWikiForms.mdwn b/TWiki/TWikiForms.mdwn index 8f3817c3..d1c0a32e 100644 --- a/TWiki/TWikiForms.mdwn +++ b/TWiki/TWikiForms.mdwn @@ -12,12 +12,10 @@ Form Templates replace TWikiCategory Tables from the 01-Dec-2000 version of TWik -## Changes from the Category Table System +## Main Changes from Category Tables Form Templates more powerful, flexible replacement for the original TWikiCategoryTable. Data from existing category tables can be imported directly. -Main changes from TWikiCategoryTable: - @@ -41,7 +39,7 @@ Main changes from TWikiCategoryTable:
Form Templates
-### Importing Existing Category Table Data +### Importing Category Table Data On upgrading from the previous TWiki, a Form Template topic has to be built for each web that used a Category Table, recreating the fields and values from the old **twikicatitems.tmpl**. The replacement Form Template must be set as the first item in the [[WebPreferences]] variable `=WEBFORM`. If missing, pages will display, but attempting to edit results in an error message. @@ -49,7 +47,11 @@ The new Form Template system should work with old Category Table data with no sp **_NOTE:_** If things aren't working correctly, there may be useful entries in `data/warning.txt`. -## Form Template Elements +## 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. + +### 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. @@ -65,9 +67,7 @@ The new Form Template system should work with old Category Table data with no sp * **textarea** - a text box; size is 40x10 (columns x rows) * **field value** - one or more values from a fixed set (select, checkbox, radio type) or free-form (text). (replaces _category item value_) -### 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. +### 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). @@ -82,10 +82,6 @@ A Form Template is simply a page containing your form, defined in a table where > | Know.OperatingSystem | checkbox | 3 | Know.OsHPUX, Know.OsLinux, > Know.OsSolaris, Know.OsWin | blah blah... | > | Know.OsVersion | text | 16 | | blah blah... | - -### Defining a Form in One Topic - -> **Example: WebFormTemplate from the TWiki.Know web** > > > @@ -118,16 +114,16 @@ A Form Template is simply a page containing your form, defined in a table where > >
-### Defining a Form in Multiple Topics +### Defining a Form with Multiple Topics The Form Template can also be defined in an alternative way by using more then one topic: -* A Form Template topic defines the form. -* Values of fields that have more then one value - radio, select, checkbox - can be defined by field value Template 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. -> **Code from:** +> **Example: WebFormTemplate** > -> * WebFormTemplate of the TWiki.Know web: +> * Know.WebFormTemplate Form main definition:
 
> > > @@ -139,26 +135,26 @@ The Form Template can also be defined in an alternative way by using more then o > > > -> +> > > > > > > -> +> > > > > > > -> +> > > >
NameTypeTopic Classification? select 1   ... blah blah...
Operating System? checkbox 3   ... blah blah...
Os Version? text 16   ... blah blah...
> -> * TopicClassification topic: +> * Know.TopicClassification field value definition:
 
> > > @@ -181,9 +177,7 @@ The Form Template can also be defined in an alternative way by using more then o > >
NameType
-#### Implementation Notes - -* * This format allows you to define field items with / without [[TWiki/WikiNames]], depending on your needs. +* **Implementation Notes:** This format allows you to define field items with or without [[TWiki/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]] @@ -209,9 +203,13 @@ Forms are enabled on a per web basis. The **WEBFORMS** variable in * other than checkboxes: `name`, ex: `?BugPriority=1` * checkbox: `namevalue=1`, ex: `?ColourRed=1`.
Boxes with a tick must be specified. -## Creating New Topics with Forms +## 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 WEBFORMS Preferences variable set, an **Add Form** button appears at the bottom of the page. If the [[WebTopicEditTemplate]] topic has a form added, the form will appear with values set; press **Change** to remove the template or to switch to a different one. +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. -- cgit v1.2.3