Collecting information from your site’s Users is important, whether you’re asking them to submit a brief survey or apply for a mortgage. In either case, you need to design a form. Liferay gives you almost limitless form building capability with the Forms application (also referred to as Liferay Forms). For a complete list of form fields available in Liferay Portal, visit the form fields reference article.
Because the complexity of use cases for the Forms application varies from needing only one basic input field, to needing many pages of fields with many different configurations, it makes sense to show you how to quickly build simple forms that can be ready for use very quickly, and show you a case where a form is long, complex, and needs to be well planned in order to capture the needed information. Here’s a sampling of the what the Forms application can do right now (yeah, there’s even more planned for future releases):
- Populate a Select or Radio field with a REST Data Provider
- Make a field appear based on the value entered into another field
- Add extra pages to the form
- Enable CAPTCHA for a form
- Store results in JSON
- Enable workflow for the form
- Redirect to a different URL after a successful form submission
- Send an email notification to administrators whenever a form is submitted
- Provide a default value (entered if left alone by the user) or a placeholder value (not entered if left alone by user) for each field
- Validate fields using a number of different criteria
If you only need a very basic form, don’t worry. Despite this long list of more complex options, developing a simple, elegant form to suit basic needs takes little effort. The next article will cover basic form building, and will be followed by a more complete, complex tutorial on the Forms application.