Numerous types of form fields are built into Joomla! The following describes the common standard types and their parameters.
Form Field Type Subform
The form field type subform provides a method for using XML forms within another or for reusing forms within an existing form. When the multiple
attribute is set to true
, the contained form is repeatable.
The field has two predefined
layouts for displaying the subform as either a table or a div container, as well as support for custom layouts.
I show an example of an XML field definition for repeatable mode below. Fundamental is the line multiple="true"
.
<field
name="domains"
type="subform"
label="COM_USERS_CONFIG_FIELD_DOMAINS_LABEL"
hiddenLabel="true"
multiple="true"
layout="joomla.form.field.subform.repeatable-table"
formsource="administrator/components/com_users/forms/config_domain.xml"
/>
I have not found an example for multiple="false"
in Joomla. A use case might be if the number of subforms depends on a condition. Then multiple="false"
can be useful.
Link[docs.joomla.org/Subform_form_field_type]
Webmentions