Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Element Multiple

Security covered Under active development 212 sites

This module provides a form element that makes it easier to create and manage multiple sets of related form fields. It allows you to define a repeatable group of fields, such as first and last name, and add or remove instances of that group as needed.

A form element for lists of values, with sorting, AJAX add and remove, and limits.

Element Multiple is a developer module. It provides the form element type element_multiple for custom forms. The element renders a fieldset with a table of rows, drag-and-drop sorting and AJAX add and remove operations, and it can limit the number of rows. The module has no admin interface.

Features

  • Single or composite rows, with several columns, headers and keyed rows.
  • Drag-and-drop sorting, with a weight fallback that works from the keyboard and on small screens.
  • AJAX add and remove, and an "Add more" button with a number of rows.
  • Cardinality, minimum rows and a hard cap on rows.
  • Required children, #states between the fields of a row, machine_name and date children.
  • Server-only children: value and #access FALSE children never travel through the browser.
  • #is_empty and #row_alter callbacks to decide which rows count and to change a single row.
  • Icons that follow the text color, so the element works on light and dark admin themes.

Usage

A list of text values:

$form['tags'] = [
  '#type' => 'element_multiple',
  '#title' => $this->t('Tags'),
  '#default_value' => ['Alpha', 'Beta', 'Gamma'],
];

The submitted value is the list of rows, in the order of the table. Empty rows are dropped.

Documentation

The documentation site explains every option of the element with an example and a screenshot, and the property reference lists every property with its type and default.

Looking for Drupal support?

Premium support from the project maintainers
Get in touch with us
Drupal 11 · not 10 PHP 8.3

Ask your assistant about Element Multiple

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

1 tracked project depends on this one

Activity

Tracked releases
7
Tracked since
Nov 2023
Latest release
3 weeks ago
Releases (12 mo)
3 ▲ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.2.0 Stable 11 PHP 8.3 Nov 5, 2026
1.1.0 Stable 10–11 May 15, 2026
1.0.6 Stable 10–11 Mar 23, 2026
1.0.5 Stable 10–11 Nov 25, 2025
1.0.4 Stable 10–11 Jun 7, 2025
1.0.3 Stable 9–10 Nov 30, 2023
1.0.2 Stable 9–10 Nov 29, 2023