Contents
FormCreate
Description
Generates arbitrary forms. Submited data can be processed in two different ways:
- by any action that is able to process submited data (single action execution only)
by FormSubmit action plugin which can be found in ActionMarket (supports execution of multiple actions)
Note: FormCreate macro should be used together with FormSubmit action plugin.
The following HTML elements are currently supported:
- Text field
- Textarea
- Upload field
- Select box
- Check box
- Radio button
- Submit button
Download & Release Notes
Download |
Release Version |
Moin Version |
Release Notes |
2013-03-25 |
1.9.7 |
new version from ThomasWaldmann |
|
|
1.7, 1.8 |
|
|
|
1.6 |
|
See also the repository for the latest version: http://hg.moinmo.in/moin/extensions/summary
Usage
Entire form is generated by sequential execution of multiple form macro plugins. Field generation macros have to be enclosed between FormHeader and FormFooter macro. First parameter of FormHeader macro is action or list of actions to be executed after submiting a form.
FormHeader
Single action:
<<FormHeader(action[,targetfile=][,targetpage=][,targetemail=])>>
Arbitrary action can be executed this way.
Multiple actions:
<<FormHeader(action1, action2, actionN[,targetfile=][,targetpage=][,targetemail=])>>
This option can only be used with FormSubmit action plugin.
Currently supported actions by FormSubmit:
submitattachment - attach file to wikipage defined in targetpage parameter
submitcsv - append line into csv file defined in targetfile parameter and append it to targetpage attachment directory
submitemail - send an email to address defined in targetemail parameter
Parameters
action - action to process submited data
targetfile= - csv file name
targetpage= - target wiki page for attachments and csv file
targetemail= - target email for submited data
FormField
First parameter of each field except FormSubmit is label. Labels are used as header informations in csv files or emails and also as name attribute in HTML tag. Dictionary parameters are used to generate specific HTML attributes. Not all attributes are supported. Next parameters differs in each type of field.
Example
<<FormHeader(submitattachment, submitcsv, submitemail, targetfile=file.csv, targetpage=Page_for_csv_and_attachments, targetemail=email@address.net)>> || First name: || <<FormText(First name,maxlength=50)>> || || Last name: || <<FormText(Last name,maxlength=50)>> || || Gender: || Male<<FormRadio(Gender, Male)>> Female<<FormRadio(Gender, Female)>> || || Status: || <<FormSelect(Status, Single, Married, Divorced)>> || || Children: || <<FormCheckbox(Children, Yes, No)>> || || Note: || <<FormTextarea(Note, rows=10, cols=20)>> || || Attachment: || <<FormUpload(Attachment)>> || ||<-2:> <<FormSubmit(Send)>> || <<FormFooter()>>
Example shown above generates the following form:
After submission of this form, the following actions are performed:
specified attachment is uploaded into 'Page_for_csv_and_attachments' page
form data are appended into 'Page_for_csv_and_attachments/attachments/file.csv' file
form data are sent to 'email@address.net'
Copyright
2008 by Peter Bodi
License
GNU GPL
Bugs
Messages
Hi,
some month ago this library was added to the extension repo at
Improving it there is welcome
-- ReimarBauer 2013-05-30 02:28:24