Tags:
forms1Add my vote for this tag rendering1Add my vote for this tag create new tag
, view all tags

FormFieldsPlugin

Control the appearance and capability of fields in forms when editing. If Javascript isn't enabled then the form field will fall back to being a text box or if it is a built in TWiki type, the relavent HTML control.

Syntax Rules

New types for forms

  • colorchooser - still early days for this one
  • select multi="twopane" - multi-select list box, can take special value of $users (users/groups from Main)

Examples

This example can be placed in a topic called WebPreferencesForm

Name Type Size Values Tooltip message Attributes
WEBTOPICLIST textarea 60x5   List of key topics in this Web S
NOSEARCHALL radio 2 ,on   S
WEBBGCOLOR colorchooser 10 #C0C0C0 Web specific background color: (is overwritten by web preferences) S
DENYWEBVIEW select multi="twopane" 1 $users Users or groups who are not allowed to view topics in this Web. S
ALLOWWEBVIEW select multi="twopane" 1 $users Only these users or groups are allowed to view topics in this Web. S
DENYWEBCHANGE select multi="twopane" 1 $users Users or groups who are not allowed to edit topics in this Web. S
ALLOWWEBCHANGE select multi="twopane" 1 $users Users or groups who are allowed to edit topics in this Web. If empty all but those listed in DENYWEBCHANGE are allowed S
DENYWEBRENAME select multi="twopane" 1 $users Users or groups who are not allowed to rename topics in this Web. S
ALLOWWEBRENAME select multi="twopane" 1 $users Users or groups who are allowed to rename topics in this Web. If empty all but those listed in DENYWEBRENAME are allowed S
ALLOWTOPICCHANGE select multi="twopane" 1 $users Users or groups who are allowed to change this topic. If empty all but those listing in DENYTOPICCHANGE are allowed S

or in form you can use directly in WebPreferences

|  *Name*          |  *Type*     | *Size* | *Values*            | *Tooltip message* | *Attributes* |
| WEBTOPICLIST     | textarea    | 60x5   |                     | List of key topics in this Web | S          |
| NOSEARCHALL      | radio       | 2      | ,on                 |                   | S            |
| WEBBGCOLOR       | colorchooser | 10    | #C0C0C0             | Web specific background color: (is overwritten by web preferences) | S |
| DENYWEBVIEW    | select multi="twopane" | 1      | $users              | Users or groups who are not allowed to view topics in this Web.  | S |
| ALLOWWEBVIEW    | select multi="twopane" | 1      | $users              | Only these users or groups are allowed to view topics in this Web.  | S |
| DENYWEBCHANGE | select multi="twopane" | 1      | $users              | Users or groups who are not allowed to edit topics in this Web. | S            |
| ALLOWWEBCHANGE | select multi="twopane" | 1      | $users              | Users or groups who are allowed to edit topics in this Web.  If empty all but those listed in DENYWEBCHANGE are allowed | S            | 
| DENYWEBRENAME | select multi="twopane" | 1      | $users              | Users or groups who are not allowed to rename topics in this Web. | S            |
| ALLOWWEBRENAME | select multi="twopane" | 1      | $users              | Users or groups who are allowed to rename topics in this Web.  If empty all but those listed in DENYWEBRENAME are allowed | S            | 
| ALLOWTOPICCHANGE | select multi="twopane" | 1    | $users              | Users or groups who are allowed to change this topic.  If empty all but those listing in DENYTOPICCHANGE are allowed | S |

FormFieldsPlugin Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %INTERWIKIPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Control the appearance and capability of fields in forms when editing.

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip FormFieldsPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/FormFieldsPlugin.txt Plugin topic
    data/TWiki/FormFieldsPlugin.txt,v Plugin topic repository
    lib/TWiki/Plugins/FormFieldsPlugin.pm Plugin Perl module
    templates/formfields.tmpl Contains the basic HTML that is used in the edit controls
  • Test if the installation was successful:
    • enter samples here

Brief design notes

I wanted to use the richness of Javascipt, but still be functional without. I'm fairly pleased with the approach, but I'm not sure it's fully correct.

  • If Javascript is enabled then initForm is called when the edit window appear on the client. This hides the default textboxes and shows the new edit controls.
  • Values are always sent to TWiki in the normal text boxes (or other standard controls)
  • Painful differences between browers caused me some grief, not sure if I've got it right
  • Code for this is within edit.tmpl
  • Most of the HTML and JavaScript for this plugin is to be found within different sections of the formfields.tmpl template. So you can alter a fair a bit of the controls behaviour by making changes there.

Known issues

  • The colour chooser option is just about okay in IE, but useful in Netscape
  • This whole plugin is somewhat experimental

Plugin Info

Plugin Author: TWiki:Main/JohnTalintyre
Plugin Version: 04 Jun 2003 (V1.000)
Change History:  
04 Jun 2003: Initial version
CPAN Dependencies: none
Other Dependencies: Javascript on the client, but silently falls back to standard controls if not present
Perl Version: 5.005
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/FormFieldsPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/FormFieldsPluginDev

Related Topics: TWikiPreferences, TWikiPlugins, TWiki:Codev/ExtendingFormControls

-- TWiki:Main/JohnTalintyre - 04 Jun 2003

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 FormFieldsPlugin.md5 r2 r1 manage 0.2 K 2008-12-12 - 11:27 SopanShewale checksum file , Uploaded as a part of Release Process
Compressed Zip archivetgz FormFieldsPlugin.tgz r2 r1 manage 7.6 K 2008-12-12 - 11:27 SopanShewale See FormFieldsPlugin for details. Untar and run the installer script, Uploaded as a part of Release Process
Compressed Zip archivezip FormFieldsPlugin.zip r3 r2 r1 manage 9.4 K 2008-12-12 - 11:27 SopanShewale See FormFieldsPlugin for details. Unzip and run the installer script , Uploaded as a part of Release Process
Unknown file formatEXT FormFieldsPlugin_installer r2 r1 manage 3.4 K 2008-12-12 - 11:27 SopanShewale Installer Script, Uploaded as a part of Release Process
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2012-12-03 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.