Forms

The built-in form generator can be used to create interactive forms that are sent via e-mail or stored in the Contao database. Uploaded files can be sent as e-mail attachment or stored in the Contao files directory. The form generator supports four different data formats:

Format Description
Raw data The form data will be sent as plain text message with each field in a new line.
XML file The form data will be attached to the e-mail as an XML file.
CSV file The form data will be attached to the e-mail as a CSV file.
E-mail Ignores all fields except email, subject, message and cc (carbon copy) and sends the form data like it had been sent from a mail client. File uploads are allowed.

Form fields

Similar to content elements, Contao provides a separate element for each type of form field like text fields, password fields, select menus, file uploads, hidden fields or submit buttons. Here is an overview of the Contao core form fields:

Field CSS class Description
Explanation explanation A custom field to insert an explanation text.
HTML code - A custom field to insert HTML code.
Fieldset - A container for form fields with an optional legend.
Text field text A single-line input field for a short or medium text.
Password field password A single-line input field for a password. Contao automatically adds a confirmation field.
Textarea textarea A multi-line input field for a medium or long text.
Select menu select/multiselect A single- or multi-line drop-down menu.
Radio button menu radio A list of multiple options from which one can be selected.
Checkbox menu checkbox A list of multiple options from which any can be selected.
File upload upload A single-line input field to upload a local file to the server.
Hidden field - A single-line input field that is not visible in the form.
Security question captcha A simple math question to verify that the form is being submitted by a human (CAPTCHA).
Submit field submit A button to submit the form.

Front end module

The front end module is used to display forms on the website. They can be configured with the "Modules" module in the back end and have to be added to an article or page layout to actually show up on the website. The form generator extension includes one front end module:

Module CSS class Description
Form mod_form Adds a form to a page.

Content element

The content element is used to display forms on the website. They can be configured with the "Form" content element in the back end and have to be added to an article to actually show up on the website. The form generator extension includes one content element:

Content element CSS class Description
Form ce_form Includes a form.

results matching ""

    No results matching ""