There are nearly 30 options for creating Joomla forms. Fabrik is probably the most powerful of them all.
Rather than simply create forms, Fabrik allows you to create real applications. You can collect data and then feed that data into charts, maps, calendars and more.
However, although Fabrik is powerful and flexible, it can also be complicated to use. In this tutorial, we're going to give you a gentle introduction to Fabrik, and we'll show you how to set up your first form.
2. Start Creating the Form
- Click on Components > Fabrik > Forms > New to begin your first form.
- Enter a Label. This will be the name for your form.
- Set Status to Yes.
- Scroll down to the Form processing area.
- Enter a table name. This is where your form entries will be stored in the database. It is best to use only lowercase letters and underscores to create this name.
- Make sure that Save partially completed multi-page forms is set to No.
- Click on Save and Close. You have created your form and database table.
3. Add Elements to the Form
Now that you have the form, we need to add elements. Elements are the actual data that people will enter into your form. These will be things such as name, email address and phone number.
- To add new elements to your form, click on Elements > New.
- Fill in the Name. No-one will see this. This will be the column heading in your database table. It is important to keep your naming convention consistent for future implementation of code. Keep your Name all lowercase.
- Fill in the Label. This is what people will actually see when they fill in the form.
- Choose the Group. This is the name of the form you just created.
- Choose the Plug-in. This decides what type of data you'd like to collect. For your "First Name" element, you will want a "Field" plugin, which allows users to type in a textbox.
- Set Show in list to Yes. This will make the element show on your form.
- Click Save and Close
- Repeat the steps above to make all the elements you need for the form. A good example would be to create a "last_name" field element also.
4. Link Your Form to a Menu
- Go to your Menu Manager, click on your Menu, Add new Menu Item.
- Click Select next to Menu Item Type.
- Scroll down and click on Form under the fabrik heading.
- Choose your Form on the right-hand side.
- Enter the Menu Title.
- Click Save & Close.
5. View Your Form
Congratulations. You have created a form with Fabrik.
If you want to see the information entered in the form, go to Components > Fabrik > Forms and click View data next to your form.
Comments
We're really glad you found this tutorial and our site useful. Welcome to OSTraining!
Go to the 'List' tab on the Fabrik administrative page. You should see a Fabrik List with the same name as the form you created. Add a menu link to this list, the same way you added a link to the form (except choose list instead of form for the menu type). Now, go to the 'Elements' tab on the Fabrik Administrative page. For each field/column that you want to use as a search filter on your table do the following: (1) open the element's setting page (2) Open the 'List View Settings' tab (3) Click 'Filter's to open that part of the accordion view (4) Choose the appropriate option from 'Filter Type', and click 'Save'. Now, go the front-end of your joomla site and click the menu link you created for the Fabrik List. You should see the records for that list currently in the database, and above the table you will see the search/filterin g fields or dropdowns that you added for each element.
Hope this helps!
I'm trying to create a form with bindDed fields, so when i set the value of the first field, this value is used as a filter for the second field's query (both are typed databasejoin).
some thing like this (in the second field SQL statement : WHERE TABLE2.SOME_ID == TABLE1.SOME_ID.
Any ideas?
Thanks,
Roee
Just one thing, how do I send out an email to the user and admin, using the info the user entered in the form?
Any help will be greatly appreciated!
Thanks!
Otherwise thank you very much the above tutorial, it is precise and easy to understand.
Thank you so much indeed