Introduction
Forms are the heart of Fabrik, they allow you to collect data from users and access your data for editing and viewing.
List Available Forms
To access the form's section select
Components->Fabrik->Forms. You will see a page containing a list of your forms similar to the diagram below:
Form Listing Details
- # - This is the ID of the form. You can order this by ascending to descending, and vice versa.
- Label - This is the name of the form. You can order this from A-Z, or Z-A.
- Element - Opens a form for adding a new element
- Content type - Lets you export a "Content type" file containing your form settings, see also https://fabrikar.com/forums/index.php?wiki/content-type/
- Update database - Adds missing database columns to the form's DB table (e.g. if you added a complete existing group to a form) and/or creates the database table (if you set a form from "not saving to DB" to "Save to DB"). Both situations are not "usual" Fabrik workflow. Only use this option if you know what you are doing and backup before! It doesn't handle joined Groups etc.
- View data - Opens the list view of your form (if the form is saving to DB)
- Published - This tells you which forms are published or unpublished. A green "checkmark" indicates that the form is published, a red "x" indicates that the form is unpublished. You can toggle the form status directly in this form listing by clikcing on the icon.
Sorting/Filtering
You can sort the form list by form id (#), label (Label) and status (Published) by clicking on the table headers.
You can select which forms to view, based on their publishing status (all, published, unpublished, trashed) by selecting an option in the Filter drop down list on the left side of the page.
You can select which forms to view by searching for (parts of) the label in the Filter box above the form list.
Add / Edit Form Basic Settings
Each form can be selected with the check box to the left of its name. Once selected it can be altered by clicking on the buttons in the top sub-menu.
- New - Create a new form.
- Edit - Edit the selected form (note that you can also edit the form by clicking on its name).
- Publish - Set the state of the form to published.
- Unpublish - Set the form state to unpublished.
- Check In - Check in the form.
- Trash - Trash the form.
- Options - Enter the general Fabrik Options area.
- Help - Links to the related Fabrik Wiki article.
Adding/Editing a Form
You will need to create a new form or edit an existing form to view the form details interface.
Details
- Label - The form's title which appears at the top of the form.
- Introduction - This text appears under the form label and is used to let you introduce the form to your users. You have a couple of special Placeholders here:
Code:
{new: here is a new form}
{edit: we are editing a form!}
{details: here are the details for [mytable___name]}
See this forum page for info on how to use it in conjunction with the joomla Content plugin
- The appropriate text is inserted when the form is respectively a new entry, editing an existing entry or looking at a details view
- If you need to use element Placeholders within the special new/edit/details Placeholders, use [foo___bar] square brackets rather than curly brackets (you can't nest braces for Placeholders)
- Error message - This text appears at the top of the form, if it fails Validation. It should be used to explain to the user that an error has occurred and the steps to take to remedy the error. You can use language strings. Leave empty for default message (
- Footer text - (In forum etc. also named "Outro"). Text appearing at the bottom of the form. The same special Placeholders as for the introduction area can be used
Buttons
Your form has button
Options in regards to form submission, saves, previous page, next page, etc.
- Reset Button - If yes selected shows a reset button at the bottom of the form. When pressed the form's fields revert back to their initial states.
- Reset Button Label - The text displayed in the reset button.
- Copy Button - Adds a copy button to the bottom of the form. If editing an existing record, this button will save the data as a new record. When adding a new record this button has the same effect as the save button.
- Copy Button Label - The text displayed in the copy button.
- Back Button- Adds a go back button to the bottom of the form, when pressed this button takes you back to the previous page without saving or submitting the form.
- Back Button Label - The text displayed in the go back button.
- Apply Button- Adds an apply button to the bottom of the form, allowing the user to save the record and return back to the form to continue editing it.
- Apply Button Label- The text displayed in the apply button.
- Delete Button - Adds a delete button to the page, allowing the user to delete the records. The form must save to a database table and the user must have delete access rights (defined in the form's list)
- Delete button label - The delete button's text.
- Submit Button- The text displayed in the submit/form entry button.
- Submit Button Label- The text displayed in the submit button (Submit buttons are always shown at the bottom of the form).
- Submit on Enter - If set to yes then the form will be submitted when a field is focussed and the keyboards enter key is pressed. Note that some focussed fields will not trigger the submit, including text areas and select Lists.
Form Processing
Basic form processing
Options.
- Record in Database - If ticked the then form saves the data into a database table.
- Table Name - If editing a form this shows you the table that the form is saving to. If creating a new form this is a field into which you can enter the name of the database table that you want to save the form's data to. The table is created in the database defined by the default connection. This table name must not exist already.
- Ajax Validation - If 'yes' selected then each element is validated as its data is changed. Validation occurs on the server, so is more secure than simple Javascript Validation. Feed back on success or failure of the Validation is shown next to each element as a real time animated effect. Note whether set to 'yes' or 'no' Validation will always occur when the form is submitted.
- Success Message - The message shown when the form has been successfully submitted. If left blank the default success message will be shown
- Suppress Messages - Suppreses all success messages
- Spoof Check - If set to no this will remove Joomla's spoof check from the form, this makes the form less secure but allows for posting data into the table directly from a URL.
- Save Partially Completed Multi-Page Forms - If you use a multipage form (by turning on one of your Groups' 'Page break' Options), and this setting is set to 'Yes' then a cookie will be set on the computer so that if the form is not completed and the user comes back to add a record, the user will be returned to the last page they were editing. Turn this setting off if the form is likely to be used in a public place where several people will share the same computer
- Notes - This is an administration feature which allows you to make a note about the form. The content of this note is shown as a tool tip when you hover over the form's name in the form list.
Publishing
The publishing tab allows you to specify certain attributes of the form's creator and when and if the form is published:
- Status - Set to Yes to publish the form, set to No to unpublish the form. Unpublished forms can not be used in the front end.
- Creator - The user who created the form.
- Created Date - The date the form was created on.
- Start Publishing - The date and time at which to start publishing the form. Note the form has to be published for this option to be applied.
- Finish Publishing - The date and time at which to end publishing the form. Note the form has to be published for this option to be applied.
Groups
Groups are the equivalent of HTML field-sets. They are used to contain your form's
Elements. Each element you create is assigned to a group. Your form must have at least one group.
- Create a group with the same name as this form - When creating a new form this check box is ticked for you. It will automatically create a group and assign it to your form.
- Or select and add the following available groups - This will list any Groups you have previously created which have not yet been assigned to a form.
- Add - To add the group to your form select it and press this button.
- Current Groups- This shows the Groups that have already been assigned to the form. The order they appear in this list is reflected in the order they appear in the form itself.
- Up - To order a group up, select in in the current Groups list and press this button .
- Down - To order a group down, select in in the current Groups list and press this button.
- Remove - To remove a group from the form, select in in the current Groups list and press this button.
- Randomise Groups - will randomise the order in which the Groups are shown in the form.
Layout
The layout tab allows you to determine which template is used to render your form.
- Front End Templates-
- Form - Form template.
- Details View - Details view template.
- PDF template - state which template to use for the PDF rendering. Out put is as a details view - we don't support interactive PDF forms.
- PDF Orientation - set the PDF paper orientation to be either landscape or portrait
- PDF Paper Size - Increase the paper size to fit in larger sets of data.
- Admin Templates-
- Form - The form template to use when in Joomla's administration pages.
- Details View - Details view template to use when in Joomla's administration pages.
- Layout-
- Show Title - Show the form's title
- Show Title In Details View - Show the form's title in the details view
- Print Icon - Should a print icon be shown on the form/details view. This button opens up the page in a pop-up window, ready for printing
- Email Icon - Should an email icon be shown at the top of the form/details view. This allows the user to email the page to someone.
- PDF Icon - adds a PDF button to the form and details view.
Additional Information
Form templates are found in /components/com_fabrik/views/form/tmpl.
Details templates are found in /components/com_fabrik/views/details/tmpl.
Each template is contained within its own folder. To create a custom template copy one of the existing template folders, rename it and upload it to your site.
For adding custom CSS to existing templates or creating custom templates see
https://fabrikar.com/forums/index.php?wiki/index/#designers
You can override the template files in your main Joomla template's html folder.
Options
- Show Related Data Links - If this form's table has related data links set up, and you select yes for this option then each of those related data links will also appear at the top of the form
- Tip Hover Location - Element's can have addtional tip text assigned to them to help guide the user through the form submission process. This option defines where and how the tip text should be shown (above, side, below, hover)
- Process Joomla Plugins - You can include in the form intro text or in your template or in certain Fabrik Elements, text which renders Joomla content plugins. This option controls when and if these plugins are rendered.
- CCK Category - Currently this is not used
Plugins
The form plugins tab is used to add additional form processing functions such as email, paypal payments, etc. In order to setup a form plugin you simply select the
Add button to setup new plugins.
There will be additional
Options available once you add a new plugin.
- Published - Toggles on/off whether the plugin is active
- Do- The name of the selected plugin
- In - Where the plugin should be run (admin / front end / both)
- On - When the plugin should be run (new / edit /both)
- Delete - Pressing this button deletes the plugin from the form
To learn more about all of the Fabrik form plugins and configuration
Options please view:
Form Plugins
Setting Field Data on Form Load
When creating new records you can set the default value of your form's fields by appending key/values to the form URL:
E.g. if your form is located @
http://mysite.com/contact-us
and you have an element whose full name is
contacts___name then you can fill the name field with the value 'rob' by using this url:
http://mysite.com/contact-us?contacts___name=rob
to set the value of dropdown
Elements/radio buttons/checboxes append '_raw' to the end of the full element name:
http://mysite.com/contact-us?contacts___agerange_raw=1
Multiselect Joins
If you need to pre-select values in a "multi select" join element (one rendered as a checkbox or multiselect dropdown), you have to use a special placeholder, which is your join element's name with _id added, andappend [] on the query string to make it an array. The value(s) you give need to be the PK values of the table you are joining to. See this example:
http://screencast.com/t/S3beP6QKlp4L
... where we show selecting three US States from a us_states table join, with PK values of 1,2 and 4.
Working round ACL's
If your element's ACL prevents access by the logged in user, you cannot set the value directly. You will need to pass the info in via a query variable and then retrieve it using the element's Eval default.
Append the following to your URL: this_info=my_value
Where:
"this_info" is an arbitrary variable name.
"my_value" is the information you are passing in
So, for example, your URL might be
http://mysite.com/contact-us?this_info=1
Then in the Eval default for that element, you'd do:
PHP:
$app = Joomla\CMS\Factory::getApplication();
return $app->getInput()->get('this_info', '');
Using list filters values as default
You can set the element's default value to be that of the
Lists current filter value with this code:
PHP:
return FabrikHelperElement::filterValue(8);
replace 8 with your element's id and ensure that the element's default's 'Eval' option is turned on
Multi-page Forms
You need a form with multiple
Groups to create a multi-page form:
create at least one group for every form page, in group settings set "Page break" = yes
https://fabrikar.com/forums/index.php?wiki/groups/#pagination
Note in Fabrik multipage forms are not compatible with the bootstrap_tabs template