Module: Form Auto - Automatic Forms

This Module adds a new form type called Automatic Form, which allows you to store the form values into an auto-managed table (as you modify form name and form fields), adds filter, unique and count/total validation and also adds a confirmation e-mail using HTML template with tags.

The package consists of 3 parts:

  • Module – auto-store into a table, validation and back-end view, edit, delete
  • DataContainer – to wrap the form database table into a data container
  • Support Files – 2 example confirmation e-mails using both methods for tags
This package only works on TYPOlight version 2.5 and above.

Download

Discussion Forum

Installation

1. Copy folders/files into their correct locations:

  • system/drivers/DC_FormAuto.php
  • system/modules/formauto/*
  • tl_files/formauto/*

2. Run typolight/install.php to update the database configuration.

Setup

You will first create the necessary support pages and content, then you will create the Form.

Create Thank You Page with its Content

  • First, create a Page for Thank You
  • Create a Form Auto Info Module (there are no “parameters” to set)
  • Place the module above into your above Thank You page (example, use an article and add the module as a Content Element). This will display the submitted values after the registration has been completed.

Create Form

Use the Form Generator and create a Registration Form using the form generator

  • Change the Form Type to [Automatic Form]
  • Enter the Store Table value – the tablename to be auto-managed in the database, e.g. tl_form_myform1
  • [x] Jump to page – select the “THANK YOU” page above, where you placed the Form Auto Results Module – to display the posted form data correctly to the user as confirmation.
  • Click Save and Edit
REMEMBER, as the form stores data for itself, you will need a SEPARATE form for EVERY event. You can easily duplicate a form and include in a new event (usually the confirmation e-mail and thank you can be made once per site, so no other changes needed).

Create Form Fields

While adding fields, the database table will be automatically managed. Warnings will be presented if you try to create certain system columns as field names.

  • Add form fields like: firstname, lastname, email, venue, session1, session2, guests, etc.
  • If you want to use a venue to filter your results, use a radio/select fields (no multiples)
  • If you want to ensure unique entries, ensure you have a field like e-mail, which will be unique.
  • If you want to make breakout sessions, use a radio/select/checkbox fields

Add Form Validation

Go back and edit the form again. Now go down to the 3 validation types and add them using the guide below.

  • [x] Use Filtered Validation

Select a Filter field from the drop-down that will be used as a filter for validation, e.g. venue or city.

  • [x] Use Unique Validation

Select a Unique field from the drop-down that must be unique (no duplicates), e.g. email

  • [x] Use Count Validation

Select one or more Count fields from the checkbox list to add counter fields. Use the radio/select/checkbox if you want them to book multiple choice or several sessions or breakout sessions.

  • Count Maximum Values:

Enter the count maximum values using the guide below:

  • Separate each Filter option by (|)
  • Separate each Count Field by (;)
  • Separate each Count Option by (,)

Using the Image below as an Example:

Filter:

  • Venue [select] (CPT, DBN, JHB) – option values in brackets

Count Fields:

  • Breakout 1 [select] (A, B, C) – option values in brackets
  • Breakout 2 [select] (A, B, C)

Now you can enter Count Maximum Values like this:
[ 15,12,10; 30,12,10 | 10,10,10; 20,10,10 | 50,20,20; 50,30,25 ]
or in words –

  • Venue: CPT | Breakout1: A=15,B=12,C=10 ; Breakout 2: A=30,B=12,C=10
  • Venue: DBN | Breakout1: A=10,B=10,C=10 ; Breakout 2: A=20,B=10,C=10
  • Venue: JHB | Breakout1: A=50,B=20,C=20 ; Breakout 2: A=50,B=30,C=25
  • Select Total Field

Select a field from the drop-down to use as a value to count with, instead of just 1. Use this to allow the user to choose how many guests they will bring to the session (e.g. 1: just me, 2: me + partner, 3: family of 3, 4: family of 4, etc.). Here you can ONLY choose a SELECT/RADIO drop-down, as you don't want the user to type this in (to restrict his maximum).

  • Show inline free count

Select to show the free count appended to the label (text field label, or option label in select, checkbox or radio fields)

Add Confirmation E-mail

  • select the Confirmation E-mail field to use as the e-mail of the person registering, so the confirmation e-mail will know where to send.
  • Add Confirmation Sender using friendly format: Name [name@domain.com]
  • Add Subject of the e-mail
  • [*] Confirmation HTML Template – select file used as HTML template – you can add tags like {{form::firstname}} or if you're lazy, you can include 1 tag called {{formauto::all}} which will create a table and add all the fields to the e-mail (useful if you want to set-up 1 standard confirmation e-mail per site)

Support Modules

Front-end

  • Form Auto Info

This support module has no real parameters and it is used on a Thank You page to display the processed form data in readable format to the end-user, as confirmation of their form submission (as used above).

  • Form Auto Free

This support module asks for the FORM and will show a table with all the free seats available.

  • Form Auto Listing (use instead of Listing)

This support module asks for the FORM, instead of the tablename. The module works just like the listing module, but with CSV formatted export – if you use the list_formauto.tpl template.

Back-end
When you list the forms in form generator, you will see a new icon (form/users icon) next to the edit buttons. This button will allow you to view the form table data. Once you have some submitted data, the data will appear in spreadsheet data format (almost) with no headings (it assumes you know the headings in the form).

  • here you can now edit the data, if an event admin wants to change the booking for a person (mistaken booking, etc).
  • here you can also delete the entry (again, for mistakes/admin)
  • the IP and date is also recorded
  • You can also export the raw data to a CSV file (at the top)

Final Word

I know this seems like a lot, but once you've done it a few times, you'll quickly catch on. It really does make things easier.

Version History

v1.0.5 2008-04-27

  • inline free seats checkbox for the form, so you can display/remove the inline free seats in the field label (text fields) or the option label (select, checkbox, radio fields)
  • modification to the mod_formautofree.tpl template to show a single value, for single free seat fields (no breakouts or venue filters)

v1.0.4 2008-03-17

  • updated the confirmation e-mail field to support select as well (so you can use department e-mails as confirmations, e.g. sales, support, etc.)
  • Fixed bugs with FormAuto on countfull function (called by EventsAttend Module) and error on countfield when a text field is used to count (filter init values setup incorrectly)

v1.0.3 2008-02-08

  • Added Count Maximum support for each Filter Option, e.g. different venues/cities can now have different maximum booking values.
  • Added Front-end Support Modules for Info, Free and Listing
  • Appends the free remaining total for each Filter, Count, Option to the Label of that option (using the new HOOK loadFormField, thanks Leo)
  • When changing filter selection, the form is submitted, but with warning that filter has changed, without processing the remaining data
  • Its now also possible to submit the form without forcing a breakout selection, by making the count field a select field and then adding a emtpy value (e.g. Not Interested) and ensuring mandatory is off. This way a user will still be able to register an empty breakout if all the sessions are full.

v1.0.0 2008-01-26

  • Rewritten Form Storage module to Form Auto
  • Module now auto-creates database tables, columns using form Store Table and form field names.
  • Added new Use Filter Validation & field, used to submit data into a city/venue – useful when wanting 1 form for 3 cities/venues with identical agendas
  • Count Validation extended to support multiple counter fields (as a multiple checkbox list)
  • Also Count Maximum extended to support multiple counter values, e.g. 20,30,50; 10,15,20 (for 2 fields, 3 options each)
  • Form Back-end editing now correctly support checkbox fields for forms with multiple options.
  • HTML template modified “all” tag to: {{formauto::all}}

Thanks

I've borrowed heavily, sometimes just copying, from people's code like: tom (EFG), s.c.a.r.e. (Catalog) and leo (TYPOlight). Thanks a lot for your insights.

extensions/formauto.txt · Last modified: 2008-05-03 16:08 (external edit)