tags icon indicating copy to clipboard operation
tags copied to clipboard

Select Tag multiple doesn`t show selected values if there are more than one value

Open Ilkrash opened this issue 6 years ago • 2 comments

I have a field that is described in view as <%= f.SelectTag("Country", {class: "selectpicker", multiple: true, data-live-search: true, options: countries, required: true}) In model I have a field Country slices.String `json:"country" db:"country" In action this model is provided to the template If there is only one country in slices.String array, it is being displayed properly in the edit form, but if I have more than one country selected, no selected countries are displayed at all.

if I provide selected countries manually, I get all of the selected countries

c.Set("selectedCountries", project.Country)
return c.Render(200, r.Auto(c, project))
<%= f.SelectTag("Country", {class: "selectpicker", multiple: true, data-live-search: true, options: countries, required: true, value: selectedCountries})``` 

Ilkrash avatar Jul 10 '19 15:07 Ilkrash

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

github-actions[bot] avatar Sep 27 '22 03:09 github-actions[bot]

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

github-actions[bot] avatar Oct 28 '22 03:10 github-actions[bot]