Multi-value form element
This module allows you to create form elements that can repeat multiple times, similar to how fields can have multiple values. It enables users to add, remove, and reorder sets of form fields, such as name and email inputs for contacts.
Provides a multi-value form element that wraps any number of form elements.
The wrapped elements will be repeated based on the cardinality specified on the wrapper.
It basically brings the delta cardinality concept of fields to form elements.
Each set of child elements ("delta") can be re-ordered with drag-and-drop.
$form['contacts'] = [
'#type' => 'multivalue',
'#title' => $this->t('Contacts'),
'#cardinality' => MultiValue::CARDINALITY_UNLIMITED,
'name' => [
'#type' => 'textfield',
'#title' => $this->t('Name'),
],
'mail' => [
'#type' => 'email',
'#title' => $this->t('E-mail'),
],
];
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 2.0.x-dev | Dev | 11 | Jul 2, 2026 | ||
| 1.0.0-beta8 | Pre-release | 10–11 | Fix test failures over Drupal 11.2. | Nov 17, 2025 | |
| 1.0.0-beta7 | Pre-release | 10–11 | Drupal 11 compatibilty. | Feb 17, 2025 |