Module Description
This module provides a form element to assist in creation of multiple elements.
Installation
Install as usual, see Installing Drupal 8 Modules or Installing modules' Composer dependencies for further information.
Configuration
No configuration needed.
Usage
$form['multiple'] = [ '#type' => 'element_multiple', '#title' => 'Multiple values', '#header' => [ ['data' => $this->t('First name'), 'width' => '50%'], ['data' => $this->t('Second name'), 'width' => '50%'], ], '#element' => [ 'first_name' => [ '#type' => 'textfield', '#title' => $this->t('First name'), ], 'last_name' => [ '#type' => 'textfield', '#title' => $this->t('Last name'), ], ], '#default_value' => $config->get('multiple'), ]; Credits & Thanks
The Drupal 8/9 version of this module is heavily based on the Webform module
Similar modules
* Multivalue form element
Sponsors
* Amara S.A.
Installation
Install as usual, see Installing Drupal 8 Modules or Installing modules' Composer dependencies for further information.
Configuration
No configuration needed.
Usage
$form['multiple'] = [ '#type' => 'element_multiple', '#title' => 'Multiple values', '#header' => [ ['data' => $this->t('First name'), 'width' => '50%'], ['data' => $this->t('Second name'), 'width' => '50%'], ], '#element' => [ 'first_name' => [ '#type' => 'textfield', '#title' => $this->t('First name'), ], 'last_name' => [ '#type' => 'textfield', '#title' => $this->t('Last name'), ], ], '#default_value' => $config->get('multiple'), ]; Credits & Thanks
The Drupal 8/9 version of this module is heavily based on the Webform module
Similar modules
* Multivalue form element
Sponsors
* Amara S.A.
Module Link
Project Usage
55
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
This module provides a form element for creating multiple elements.
Data Name
element_multiple