data/TWiki/AnApplicationWithWikiForm.txt
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
permissions -rw-r--r--
RELEASE 4.2.0 freetown
     1 %META:TOPICINFO{author="TWikiContributor" date="1163619832" format="1.0" version="4"}%
     2 %META:TOPICPARENT{name="TWikiFAQ"}%
     3 ---++ FAQ:
     4 How can I create a simple [[TWikiForms][TWiki Form]] based application?
     5 
     6 
     7 ---++ Answer:
     8 
     9    1 Create a TWiki Form and define fields (see TWikiForms for details)
    10    1 Add the form in the list of Web Forms. Set the variable WEBFORMS in WebPreferences
    11    1 Create a Template Topic
    12    1 In edit mode add the [[TWikiForms][TWiki Form]] you defined to the Template Topic using the "Add Form" button
    13    1 Create a HTML Form with necessary fields
    14    1 Define =SEARCH= function for listing items (see VarSEARCH for details)
    15 
    16 For more information follow the links...
    17 
    18 The following is the code source of TWikiFAQ:
    19 
    20 <verbatim>
    21 <form action="%SCRIPTURLPATH{edit}%/%WEB%/">
    22 New FAQ topic: &nbsp; (Use a name in TWiki.WikiNotation) <br />
    23 <input type="text" name="topic" size="32" />&nbsp;<input type="submit" class="twikiSubmit" value="Create Topic" />
    24 <input type="hidden" name="onlywikiname" value="on" />
    25 <input type="hidden" name="templatetopic" value="TWikiFaqTemplate" />
    26 <input type="hidden" name="topicparent" value="%TOPIC%" />
    27 <br />
    28 </form>
    29 </verbatim>
    30 
    31 ----
    32 
    33 And the =SEARCH= function:
    34 <verbatim>
    35 %SEARCH{ "Back to\:__ TWikiFAQ" casesensitive="on" type="regex" nosearch="on" nototal="on"}%
    36 </verbatim>
    37 
    38 
    39 
    40 __Back to:__ TWikiFAQ
    41 
    42 __Related Topics:__ UserDocumentationCategory
    43 
    44 -- __Contributors:__ TWiki:Main.MiyokoTakushima - 18 Oct 2004