The contao advanced form bundle adds a new form-field (Formpage) to forms that can be used for multipage-forms with conditions
- Features
- How to install
- How does contao advanced form work?
- Initial setup
- Advanced setup for conditions
- Important Information
- Options
- Configurable formpage / pageswitch form-field with conditions for submitted values
- A Guest mode to show specific form pages for guests only
- Does not display form-pages when conditions are not met
- Sends all collected data on specific form page
- Compatible with all form-fields from contao
Install the package by using following command:
composer require oveleon/contao-advanced-form
After installing the contao-advanced-form-bundle, you should run a contao install to add the new fields.
Once the installation is complete, you will be able to use a new field type called "Formpage" within Contao Forms that does act as a divider for created form fields (i.e.: radio button menu, textarea, etc.).
The 'formpage' form-field acts as a page-switch and you will be redirected to it if the condition from previous submitted values is met.
-
Set up your form as usual and create your form-fields
-
Create 'formpage' fields between the form-fields that should be divided into pages
-
Add a 'submit button label' into your form-page
-
In case you want a button to get to your previous page, add a 'back button label' as well
-
Follow the initial setup mentioned above
-
Create values that can be submitted (e.g. Radio button menu) above the form-page that should meet the condition
-
Activate the "Add condition" checkbox and write your condition into it
-
The first form-page will always be divided by the first form-field and the first 'Formpage'-field.
-
Following form-pages are created by wrapping them with 'Formpage'-fields.
-
The last field in your form needs to be a 'Formpage'-field, otherwise it will show all form-fields (This is great to debug through your form).
Conditions within page-switches (Formpages) will always work for the
FOLLOWING
form-fields up to the next page-switch (Formpage)
${Field name of radio button menu} == '{Value of radio button menu}'
A radio button menu with a field name of 'Example1', and a submitted value of 'Option1' will jump to this page-switch (form-page).
$Example1 == 'Option1'
You are able to set-up complex conditions to show a certain form-page.
The submit-button and back-button are set up for the
PREVIOUS
form-page. They will work for the form-fields above the page-switch (Formpage).
Classes will always be set for the
PREVIOUS
form-page. They will work for the form-fields above the page-switch (Formpage).
Using the option 'protect form page' and 'show to guests only', will always work for the
PREVIOUS
form-page. They will work for the form-fields above the page-switch (Formpage).
| Option | Description |
|---|---|
| Submit button label | This field will add a submit button to your form-page that can be named (Next page) |
| Back button label | This field will add a back button to your form-page that can be named (Previous page) |
| Add condition | This checkbox will activate conditions. Your conditions can be written into the text-field |
| Protect form page | Restricts the form page to certain member groups |
| Show to guests only | Hides the form page if a member is logged in |


