I'd like to have a Country field allow selecting multiple countries, but using a single <select> which allows selecting more than one item. When I use "Unlimited" for this field's allowed number of values, it produces a list of single-value <select>s.

This is useful because then it can be easily integrated with something like Chosen for a nice multiple country selection field.

In fact this is what's used in the field settings form for the "Available Countries" setting. That's exactly what I want to have as the field widget.

Comments

goron created an issue. See original summary.

goron’s picture

Issue summary: View changes
goron’s picture

Issue summary: View changes
marjina-constantin’s picture

I have the same need on a project, so here is the patch :)

batigolix’s picture

Status: Active » Reviewed & tested by the community

I tested this patch & it works well.

- I switched the field storage configuration from allowing 1 value to unlimited values
- I checked the way the field is being displayed in single and multiple mode

  • dakala committed e1c4fa4a on 8.x-1.x
    Issue #3211549 by marjina-constantin, goron, batigolix: Possible to use...
dakala’s picture

Status: Reviewed & tested by the community » Fixed

@goron thanks for the report. @marjina-constantin and @batigolix: thanks for the good work. Sorry for the delay in merging.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.