This module simplifies the multi-value widgets when they have fixed cardinality (max number of values allowed).

By default, Drupal core will expose on the form the maximum number of values allowed. This means that if a field can have up to 5 items, for example, the form will have 5 empty elements. The "Add another item" button that builds another item using AJAX is only included when the field has unlimited cardinality.

This often leads to bad UX for editors:

core default widgets

There is a core issue to improve this in core: #1156338: Fixed maximum number of field values, but use «add more» similar to when cardinality «unlimited» is used

While the above issue is trying to also use the AJAX button on fixed-cardinality fields, this module takes a different approach and adds clientside JS so that extra empty elements are hidden, and only the elements below will be displayed:

- On empty fields, only one empty element
- On non-empty fields, only the non-empty elements

This module provides an "Add another item" button to reveal one new empty element at a time.

All interaction happens in the browser, there are no server/AJAX calls necessary.

Supporting organizations: 
Initial development, maintenance

Project information

Releases