Provides support for a new type, date
, in form fields. When a form field is set to this type it will no longer be editable by normal means, but only through a date selection popup.
In a form definition, enter date
where you would normally put text
. For example:
| Birthday | date | 0 | 1 April 2004 | A date |This will display an uneditable text field and a date selection icon that can be clicked to use the Mishoo Javascript calendar widget to insert a date. The
size
field is ignored.
If you want to use Javascript to create other data types in form fields, you can use this plugin as a model of how to do it.
date
type to forms
DateFieldPlugin.zip
in your twiki installation directory. Content:
File: | Description: |
---|---|
data/TWiki/DateFieldPlugin.txt | Plugin topic |
lib/TWiki/Plugins/DateFieldPlugin.pm | Plugin Perl module |
lib/TWiki/Plugins/DateFieldPlugin/build.pl | Build file |
DateFieldPlugin_installer.pl | Install script |
DateFieldPlugin_installer
to automatically check and install other TWiki modules that this module depends on. You can also do this step manually.
Name | Version | Description |
---|---|---|
TWiki::Contrib::JSCalendarContrib | >=0.96 | Used to display a neat calendar popup. Available from the TWiki:Plugins/JSCalendarContrib repository. |
edit
template (in the templates directory). The actual file name to edit will depend on the skin you are using, but will usually be edit.pattern.tmpl
or edit.tmpl
or similar. Add the following line to the HEADER block:
<!-- INCLUDEJSCALENDAR -->If you are using pattern skin (
edit.pattern.tmpl
), it should be added just after the line reading:
%TMPL:DEF{"script"}%
Author: | TWiki:Main.CrawfordCurrie http://www.c-dot.co.uk | ||||||
Version: | 1.000 | ||||||
Copyright ©: | 2004 Crawford Currie | ||||||
License: | http://www.gnu.org/copyleft/gpl.html? | ||||||
Change History: | |||||||
9 Dec 2004 | 1.000 initial version | ||||||
Dependencies: |
| ||||||
Home: | TWiki:Plugins/DateFieldPlugin | ||||||
Feedback: | TWiki:Plugins/DateFieldPluginDev |
Related Topics: TWikiPreferences, TWikiPlugins, TWiki::Plugins/FormFieldsPlugin
-- TWiki:Main/CrawfordCurrie - 17:29:44 06 December 2004