Extension:PostForm

Requirements

 * php-dom
 * php-mssql (to use parameter for dropdownlist)

Installation
To install this extension
 * Create folder "/extensions/PostForm"
 * Create files: PostForm.php, PostForm.xsl, PostFormShort.xsl, script.js (see section)
 * Copy these files in the folder "/extensions/PostForm"
 * Add the following to LocalSettings.php:

Syntax
Form Title  - input string  - textarea  - dropdown list (select) - empty item item value  - dropdown list v.2  - dropdown list v.3 DB server address DB type (MySQL, MSSQL) Field SQL-condition  - Group of radiobuttons   - single checkbox  - checkbox group    - submit button Text with a successful form submission

Google Translate was used for translation

The form may be a short form (when you need to save space). In this case the field names are written in the text box. When you click on the field - the name disappears, and you can begin typing. To use a short form form, you must specify a parameter: short = "yes". Example:  ...

Fields "iradio" and "icheckbox" may have a parameter: checked = "", which means that the field will be marked by default. In one "radiogroup" only one element "iradio" may have an attribute: "checked"; if it is present in several elements, it selected will be the last marked.

Fields "itext", "itextarea", "iselect" may be setting req = "", which means "required field", and in this case the field pomechaetmsya asterisk (*). When submitting a form is verification of mandatory fields on the availability of data. If the test fails, a diagnostic message.

For the dropdown list there is the possibility of positioning and filtering as you type. In order to use it, you need to move the focus to the element of the list (by clicking on it or using the key Tab) and start typing. As you type in the list will remain only those elements, which include the typed text. To return the list to its original state, it is necessary to divert the focus from the element (by clicking elsewhere in the form or press Tab).

In the "iselect" v.2 must write the name of the downloaded files with the contents of the following format: ... ...</ item> ... </ list>

Field "iselect" v.3. Getting data from SQL-source. Parameter - type of database. The options are: MySQL, MSSQL Parameters:, , - are not binding and are used only in case of their instructions. By default database connection is with the following data: user: wikisql password: asdfghjkl That is in the source database must exist a user with that password. Attention! The user should be the minimum rights, giving him only the right to read the data. Otherwise, there is risk of damage or loss of data, as well as communication with the server is low-level.

Sample
<postform to="mail@domain.com" subject="Mail Subject" from="wiki@wikidomain.org">Form Sample <itext title="Input text" name="Input_text"/> <itext title="Required Input text" name="Required_Input_text" req=""/> <itextarea title="Textarea" name="Textarea"/> <iselect title="Dropdown list" name="Dropdown_list"> Item 1 Item 2 Item 3 <radiogroup title="Radiobutton group" name="Radiobutton_group"> <iradio title="radio 1" value="1" checked=""/> <iradio title="radio 2" value="2"/> <iradio title="radio 3" value="3"/> <icheckbox title="Single checkbox" name="Single_checkbox"/> <checkboxgroup title="Checkbox group"> <icheckbox title="checkbox 2" checked=""/> <ibutton title="Send"/>

Result: Form Sample Short Form Sample

Code

 * PostForm.php
 * PostForm.xsl
 * PostFormShort.xsl
 * script.js