Form Plugin Examples
See System.FormPlugin Please view the raw text of this topic to learn how these forms are created.Form elements
Format
Multi-select items
Disabled
Read-only
Password
Date
Getting form feedback
Retrieving values with URLPARAM
Submit form to view values:- Name =
- Friends =
Formatting forms
Hints and mandatory indicators
Format: example of items on one line
For example setting paramelementformat=" $t $e $m $h ":
Adding CSS styles
Setting:formcssclass="foswikiFormSteps" elementcssclass="foswikiFormStep"
Custom CSS classes
Javascript enhancements
Focus
This example is disabled by default, because new browsers automatically scroll the page to the input field with focus. Show Focus example Original source:
%STARTFORM{
name="focusform"
action="view"
}%%FORMELEMENT{
name="Name"
type="text"
focus="on"
title="Your name:"
}%%ENDFORM%
Placeholder text
Click on the field...onMouseOver, onMouseOut
Mouse over the field...onSelect, onBlur
Doubleclick on the text to select it...onKeyUp
Change the text... (in fact,onChange can be used as well, but that tends to react slower)
Change output will be written here...
onClick
Click a checkbox...onSubmit
Give a warning before submitting the form...Validation
If the form is filled in correctly you will be redirected to FormPluginExamplesFeedback.Substitution of field references
Reference field values as variables. In hidden field 'CarbonCopy' we are creating a combined entry ofName and Password fields:
%FORMELEMENT{
name="CarbonCopy"
type="hidden"
default="$Name earns $Salary"
}%
Real world examples
Create a new AUTOINC page
Save topic text to another topic
Save field value to another topic
Upload
Working with other extensions
SendEmailPlugin form
E-mail form for SendEmailPlugin - form works if the plugin is installed and enabled. %SENDEMAIL%Accessing other sites: Flickr
This form lets you search for Flickr photos that have been tagged with a name. Note: for this example to work, addhttp://www.flickr.com/ to {PermittedRedirectHostUrls} in configure.