Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Datalist

Security covered Under active development 273 sites

This module adds an HTML datalist form element to Drupal, providing a user-friendly and accessible alternative to traditional select fields by offering built-in search capabilities. It also includes a clear button, basic theming, and a Webform element, with a field type currently in development.

What does it do

Adds a form element for a HTML Datalist.
Adds an extra's "clear" field button and basic theming.

It works more or less the same as a select field but this has built in search capabilities.
This is actually better for accessibility and other use cases then for example select2 and others which aren't really accessible (even though they come close).

When providing options to datalist make sure it's an associative array. (Value => label)
The value will be submitted, the label is visible. (This can be tweaked via the use_keys settings).

A Webform element is also present.

A field type is in development.

Usage

<?php
 $form['list_of_xxx'] = array(
 *   '#type' => 'datalist',
 *   '#options' => [
        1 => 'Label 1',
      ],
 *   '#title' => 'Title',
 *   '#required' => TRUE,
 *   '#....
 * );
?>

Why?

For accessibility and UX reasons we've switched from select, select2 and others to HTML Datalist.

Supporting organizations

  • Federal Police Belgium

Drupal 9–11

Ask your assistant about Datalist

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
7
Tracked since
Oct 2023
Latest release
2 months ago
Releases (12 mo)
2 ▼ from 4
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.10 Stable 9–11 Jul 22, 2026
1.0.9 Stable 9–11 Jul 17, 2026
1.0.8 Stable 9–11 Jan 29, 2025
1.0.7 Stable 9–11 Dec 3, 2024
1.0.6 Stable 9–11 Nov 21, 2024
1.0.5 Stable 9–11 Nov 12, 2024
1.0.4 Stable 9–10 Oct 25, 2023