r7 - 16 May 2007 - 06:27:12 - PeterThoenyYou are here: TWiki >  Plugins Web > HtmlFormsPlugin
Tags:
forms 1 Add my vote for this tag, , create new tag

HtmlFormsPlugin

This plugin can be used to make html forms that set TWikiVariables. SELECT, CHECKBOX and RADIO can be used to select from a comma separated list of options (that could be defined using a SEARCH), while BUTTON, TEXTVALUE and TEXTAREA will set the TWikiVariable based on the value.

I will be using SELECT to allow the user to set a variable to a set of topics, which they will later publish to a web site using TWiki:Plugins/PublishContrib.

Syntax Rules

  • %CHECKBOX{}%
  • %RADIO{}%
  • %SELECT{}%
    • options="" - the comma separated list of options, or VARIABLE containing or resulting in such a list (SEARCH is valid)
    • currentvalue="" - single value, or comma separated list of values as appropriate
    • destinationaddress="Web.Topic.VARIABLENAME" (and where Web & Topic can be left out for the usual context driven locations
  • %TEXTVALUE{}%
  • %TEXTAREA{}%
  • %BUTTON{}%
    • value="" - the value to set the destination to
    • destinationaddress="Web.Topic.VARIABLENAME" (and where Web & Topic can be left out for the usual context driven locations

future development

  • the addressing scheme is going to change to be XPathy
  • make all buttons submit all changes - just like inline edit!!
  • %FORMVALUES{"Web.FormDefinitionTopic.FormfieldName"}% - returns a comma separated list of options defined for that form field
  • later make a TOM like destination and source value syntax to get values from text, formfields etc

Examples

select multiple values from a scrolling selection list, and set WHOWILLITBENOW in Sandbox.WebHome topic

%SELECT{options="mary, peter, annabel, nicky, jennifer" currentvalue="%WHOWILLITBENOW%" destinationaddress="Sandbox.WebHome.WHOWILLITBENOW"}%

if installed

%SELECT{options="mary, peter, annabel, nicky, jennifer" currentvalue="annabel, jennifer, bananaman" destinationaddress="Sandbox.WebHome.WHOWILLITBENOW"}%

demo


select multiple values from a checkbox group list, and set WHOWILLITBENOW in this topic

%CHECKBOX{options="mary, peter, annabel, nicky, jennifer" currentvalue="%WHOWILLITBENOW%" destinationaddress="WHOWILLITBENOW"}%

if installed

%CHECKBOX{options="mary, peter, annabel, nicky, jennifer" currentvalue="annabel, jennifer, bananaman" destinationaddress="WHOWILLITBENOW"}%

demo








select one value from a radio selector list, and set WHOWILLITBENOW in this topic

%RADIO{options="mary, peter, annabel, nicky, jennifer" currentvalue="%WHOWILLITBENOW%" destinationaddress="WHOWILLITBENOW"}%

if installed

%RADIO{options="mary, peter, annabel, nicky, jennifer" currentvalue="annabel, jennifer, bananaman" destinationaddress="WHOWILLITBENOW"}%

demo








use a single line text edit, and set WHOWILLITBENOWTEXT in this topic

%TEXTVALUE{value="There once was a girl" destinationaddress="WHOWILLITBENOWTEXT"}%

if installed

%TEXTVALUE{value="There once was a girl" destinationaddress="WHOWILLITBENOWTEXT"}%

demo


use a multi line text edit, and set WHOWILLITBENOWTEXT in this topic

%TEXTAREA{value="There once was a girl" destinationaddress="WHOWILLITBENOWTEXT"}%

if installed

%TEXTAREA{value="There once was a girl" destinationaddress="WHOWILLITBENOWTEXT"}%

demo


and set WHOWILLITBENOWTEXT in this topic to "There once was a girl"

%BUTTON{value="There once was a girl" destinationaddress="WHOWILLITBENOWTEXT"}%

if installed

%BUTTON{value="There once was a girl" destinationaddress="WHOWILLITBENOWTEXT"}%

demo


Plugin Installation Instructions

Plugin Info

Plugin Author: TWiki:Main.SvenDowideit
Copyright: © 2006, SvenDowideit@WikiRingPLEASENOSPAM.com
License: GPL2 (GNU General Public License)
Plugin Version: September 2006
Change History:  
September 2006: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins/Benchmark: GoodStyle 99%, FormattedSearch 99%, HtmlFormsPlugin 99%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/HtmlFormsPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/HtmlFormsPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/HtmlFormsPluginAppraisal

Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

Topic attachments
I Attachment Action Size Date Who Comment
elsemd5 HtmlFormsPlugin.md5 manage 0.4 K 12 Sep 2006 - 12:54 SvenDowideit md5 checksums, calculated for .zip. tgz and .pl
ziptgz HtmlFormsPlugin.tgz manage 18.1 K 13 Sep 2006 - 04:34 SvenDowideit Download, untar and run the installer script for manual install
zipzip HtmlFormsPlugin.zip manage 19.6 K 13 Sep 2006 - 04:34 SvenDowideit Download, unzip and run the installer script for manual install
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r7 < r6 < r5 < r4 < r3 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo