WikiForms Form Plugin Example#
This page uses the WikiForms plugins to provide parameters to the CurrentTimePlugin, and displays the result.
Giving Defaults#
The first item, hidden in normal WikiPage viewing, looks like this:
[{FormSet form='testform' format='EEE, d MMM yyyy HH:mm:ss Z' rd1='r2'}]
The FormSet plugin sets the default date format for a form field format in form testform. (It also sets a radio button default value - just for demonstration, no real functionality.)
Form Output and Error Messages#
The second item, also hidden, looks like this:
[{FormOutput form='testform' handler='CurrentTimePlugin' populate='handler'}]
It specifies that the CurrentTimePlugin, which comes in the stock JSPWiki distribution, should be used to generate some output to display here. While the output is usually built in response to a POST from a form called testform, the populate attribute here hints the plugin that we want default information even if no post has been made. This is what the output looks like:
Opening the Form#
The third element starts the actual HTML form called testform:
[{FormOpen form='testform'}]
Go ahead, click on Update, and notice how your format changes and selections are retained.
Synopsis:#
- (Optional) Start with the FormSet, give defaults
- (Optional) If the form is supposed to give out information, add an output
- (Mandatory) open the form
- (Optional) add any text/select elements
- (Mandatory) add a submit
- (Mandatory) close the form