Allow multiple values to fields at Form API forms

Created on 15 December 2023, over 1 year ago

Problem/Motivation

Several elements allow multiple values, such as entity_reference, or file.
Others like tel, textfield, url could benefit inserting multiple values, which is not possible now

Proposed resolution

  • Investigate which elements can have more values than one (one example this doesn't apply is 'radio')
  • Allow the property in these elements like file's '#multiple' or similar and display the proper widget.

Elements we could apply this feature to are:

  • tel
  • textfield
  • url
  • color
  • email
  • number

This behaviour can be enabled only when the developer increases the cardinality of that field, in order not to break current sites.
In submit and validate functions, the value of that field will be an array when the cardinality is >1, and on =1 stays a string/object (depending on field type)

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
FormΒ  β†’

Last updated about 5 hours ago

Created by

πŸ‡¬πŸ‡·Greece dimitriskr

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024