... Elxis version 2009.3 codename Aphrodite is out, download it from Elxis Download Center (EDC) ...
Eforms
From Elxis Official Documentation
Contents |
eForms : An easy way to display forms inside Elxis content items
eForms is a bot that allows you to put HTML forms inside Elxis content items and autonomous pages. The bot will generate the layout of the form and also process its action. The form's elements are stored inside an XML file (data.xml). You can have unlimited number of forms and you can also put multiple forms inside the same content item. eForms is also CSS/XHTML valid, RTL compatible, multi-lingual and has javascript/PHP validation over the user submitted data. The bot is shipped with a sample form, located in data.xml file, containing all the different element types eForms support in order to see how each element type should be formatted.To integrate an eForms form inside a content item just type:
{eforms}form_name_here{/eforms}
Bot eForms is released for free under the Creative Commons 3.0 share alike license.
Current version: 1.1 (September 4, 2010)
Download: eForms on EDC
Developed by Ioannis Sannos
Begin creating your form
Open file mambots/content/eforms/data.xml with a text editor such as psPad. We will place our forms by using an XML format inside the eforms start and ending tags. Each form is placed inside form tags.
<eforms>
<form name="forma" method="POST" action="email">
Form A
</form>
<form name="formb" method="POST" action="email">
Form B
</form>
<form name="formc" method="POST" action="http://www.site.com/process.php">
Form C
</form>
</eforms>
General form info
In the very top of each form tag we place general information about the form.
<form name="samplecontact" method="POST" action="email">
The form tag has the following attributes:
name: This attribute is highly important and should be unique. This sets how we will call the form. So as our sample form has name samplecontact to display that form we will write inside a content item:
{eforms}samplecontact{/eforms}
method: The form's submit method. Options: POST, GET. Set it to POST if the action is email.
action: Action should be email if you wish eForms to email you the submission results or any URL if you wish an other script to handle the submitted data.
Form's title
<title>Contact us</title>
The above shows you how you can set a title for your form. If you dont want your form to display a title (h3 tag), leave this empty.
Description text
<description>text here</description>
This is a description of the form shown exactly bellow the title element. If you wish to write HTML include your text inside a CDATA area. If you dont want to display a description leave this element empty.
Success text
<onsuccess>text here</onsuccess>
If the form's action is e-mail and you wish to display a custom message after the successful submission of the form write your message here. If you wish to write HTML include your text inside a CDATA area. If you ommit this field or leaev it empty a default text will be displayed instead.
Email addresses
<email>name1@domain.com;name2@otherdomain.gr</email>
Write the email addresses you wish to receive the submission results separated by ; If you leave this empty the email will be send to the site's global e-mail address.
Submit button
<submit>Submit eForms!</submit>
Write the text that will be displayed in the submission button. If you leave this empty it will be displayed a multilingual version of the word Submit.
Form fields
An items tag sets the area where the form fields are located. Each field is described by an item tag.
<items>
<item>
field A
</item>
<item>
field B
</item>
</items>
Here are all the field types eForms currently supports.
text
Generates an input text box.
Set the field as required to be filled in by setting required="1"
You can also use the attribute accesskey to display access keys for blind people, etc (example: accesskey="K").
date
Displays a date pick field with Elxis calendar.
email
sendcopy is optional. if you set sendcopy="1" then the notification e-mail will also be sent to the email address that was be filled-in in this field (if not empty).
number
It is like the text field but with different validation (requires the filled-in value to be a numeric string).
<item type="text" label="Your name" required="1" size="20" default="" description="Please enter your name"></item> <item type="date" label="Departure date" required="1" description=""></item> <item type="email" label="Your email" size="30" required="1" sendcopy="1" default="" description=""></item> <item type="number" label="P.O. Box" size="5" required="0" default="" accesskey="N" description=""></item>
url
It is like the text field but with different validation (requires the filled-in value to be a valid URL address).
textarea
Displays a textarea field to write long text. Set the cols and rows attributes to set the textarea size.
select
Displays a drop-down selection field.
separator
Displays an horizontal rule. Use it if you wish to split your form into multiple blocks.
<item type="url" label="Web site url" size="40" required="0" default="http://www.mysite.com" description=""></item> <item type="textarea" label="Message" cols="60" rows="3" required="1" default="" description="Write a message"></item> <item type="select" label="Favorite team" default="Olympiacos" description=""> <option>Olympiacos</option> <option>PAOK</option> <option>Panathinaikos</option> </item> <item type="separator" label="" default="" description=""></item>
h3
Displays a title (h3 tag). You should fill-in only the label attribute. If you wish you can apply a custom CSS class by filling in the class attribute (version 1.1+).
p
Displays a paragraph of text (p tag). You should fill-in only the description attribute. If you wish to enter HTML and/or text then instead of writing your text inside the description attribute add it inside the item tags. If you wish you can apply a custom CSS class by filling in the class attribute (version 1.1+).
country
Displays automatically a country drop-down selection field (multi-lingual country names).
range
Displays a drop-down selection field consisted by a range of numbers (integers). Set the minimum and the maximum number separated with ; in the options attribute. Example: 10;16 will generate these options: 10,11,12,13,14,15,16. You can change the way the sequence number increases by setting properly the step attribute. For example for 10;16 with step="2" the result will be: 10,12,14,16 and with step="3": 10,13,16.
<item type="h3" label="Other details" default="" description="" class=""></item> <item type="p" label="" default="" description="" class="">You can write text to be displayed as a paragraph.</item> <item type="country" label="Country" required="1" default="GR" accesskey="C" description="Select your country"></item> <item type="range" label="Age" required="1" options="1;40" step="1" default="20" description="Select your age"></item>
price
Displays a text box that validates as a price. Use the currency attribute to display the currency information.
radio
Generates a radio boxes group.
checkbox
Generates a check boxes group.
captcha
Generates a security code (captcha) input field. This field is always required. Added on eForms v1.1.
hidden
Generates an input text box that is hidden by the guests.
<item type="price" label="Price" default="0.00" size="10" currency="EUR" description=""></item> <item type="radio" label="Gender" required="0" default="Male" description=""> <option>Male</option> <option>Female</option> </item> <item type="checkbox" label="Hobbies" default="" description="You can pick multiple choices"> <option>Football</option> <option>Basketball</option> <option>Hndball</option> </item> <item type="captcha" label="Security code" default="" description=""></item> <item type="hidden" label="quantity" default="5" description=""></item>
Bot parameters
eForms bot has the following parameters.
- Label width. Sets the width (in pixels) of the label element. Default value is 140.
- Description position. Sets where the description for each form element to be displayed. Options are: Bellow the element and next to the element.




