TWiki> TWiki Web>HtmlFormsPlugin (12 Sep 2006, SvenDowideit? )EditAttach

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 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@WikiRing.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

Form definition 'PackageForm' not found
Topic revision: r3 - 12 Sep 2006 - 10:27:10 - SvenDowideit?
 
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
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.HtmlFormsPlugin