Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Entity reference autocomplete FormElement with add more

No security coverage Under active development 5 sites

Part of the Entity ecosystem · 308 projects

This module provides a way to add multiple entity references in custom forms, similar to the entity reference autocomplete widget but without requiring field storage. It allows developers to create an autocomplete input field with buttons to add and remove individual entity references.

If non-entity custom form require a form element that allows adding entity reference and individual entity need to be added using it's own input field same as "entity_reference_autocomplete" widget with tags=false, this module provides that ability. As "entity_reference_autocomplete" require field storage attached to it, it only works with entity forms. This module is a light weight alternative that can be used for any custom forms. This module is only for developer use.

Features

Allows referencing other entities in a custom form. It provides an entity autocomplete input box and "add more item", "remove" buttons to add multiple reference entities using individual inputs.

Post-Installation

This is for dev use only, after installation this module enables a new FormElement type called "entity_reference_autocomplete_add_more".

Example code:

<?php
$form['field_name'] = [
      '#type' => 'entity_reference_autocomplete_add_more',
      '#target_type' => 'entity_type',
      '#title' => $this->t('Field label'),
      '#selection_settings' => ['target_bundles' => ['bundle_name'], 'match_limit' => 15],
      '#default_value' => [0=>['target_id' => 123],1=>['target_id' => 234]],
];
?>
Drupal 10–11

Ask your assistant about Entity reference autocomplete FormElement with add more

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

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Aug 2025
Latest release
9 months ago
Releases (12 mo)
1
Maintenance
Slowing

Releases

Version Type Core PHP Release date
1.x-dev Dev 10–11 Dec 16, 2025
1.0.0 Stable 10–11 Aug 10, 2025