Creating Forms in Joomla!
HTML forms are an important part of web development as they allow you to ask for information from your users. In Joomla!, we can define our forms with a simple XML file; the Joomla! FrameworkTM takes care of almost all the work.
In this chapter, we will learn how to create HTML forms in Joomla!. We’ll learn how to add the form fields that are already developed in Joomla! and how to create custom form fields. We’ll also learn how to validate our users’ input before they submit the form and how to check the data on the server side.
These are the main topics of this chapter:
- Defining forms in Joomla!
- Using standard Joomla! form fields
- Defining custom form field types
- Using the
subform
field - Validating user input on the client side
- Validating user input on the server side
By the end of this chapter, you will be able to add different forms to your extensions and retrieve the data sent by them.