# Why is \`\<select multiple\` bound to \`string\[\]\`? (solved)

**URL:** <https://discourse.aurelia.io/t/why-is-select-multiple-bound-to-string-solved/5506>\
**Category:** Framework Knowledge\
**Created:** [July 30, 2024, 11:14am UTC](https://discourse.aurelia.io/t/why-is-select-multiple-bound-to-string-solved/5506 "2024-07-30T11:14:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nenadvicentic](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/nenadvicentic/32/1191_2.png) [@nenadvicentic](https://discourse.aurelia.io/u/nenadvicentic)\
**Post date:** [July 30, 2024, 11:14am UTC](https://discourse.aurelia.io/t/why-is-select-multiple-bound-to-string-solved/5506/1 "2024-07-30T11:14:46Z")

</div>

Hi there,

I have a question. Maybe this is a bug as well, since behavior is different than Aurelia v1.

When binding `number[]` to `<option>` elements, upon user making a selection, selected values turn into an array of string (`string[]`).

So, for example, options are bound to `[1, 2, 3, 4, 5]`. User selects 1 and 4, selected value (on `<select>` element is `['1', '4']`.

There is a StackBlitz example. Two dropdowns:

- First one is bound to numbers in the template using `value.one-time`.
- Second one is bound to an array defined as a property of a component.

> **[Aurelia v2 - bindign dropdown with \`multiple\` option. - StackBlitz](https://stackblitz.com/edit/aurelia-v2-dropdowns)**
>
> Small example with 2 dropdowns bound in 2 different ways to number\[\], selection being represented as string\[\]

I also noticed another “quirk” - properties to which `select` elements are bound have to be initialized upfront to an empty array `[]`, otherwise interpolation binding to display values does not work. This happens even in simplest a possible example:

> **[Aurelia v2 - bindign dropdown with \`multiple\` option. (simple) - StackBlitz](https://stackblitz.com/edit/aurelia-v2-dropdowns-xl58sc)**
>
> Small example with 2 dropdowns bound in 2 different ways to number\[\], selection being represented as string\[\]

Again, in Aurelia v1, this would work.

---

<div class="post-metadata">

**Author:** ![nenadvicentic](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/nenadvicentic/32/1191_2.png) [@nenadvicentic](https://discourse.aurelia.io/u/nenadvicentic)\
**Post date:** [July 30, 2024, 1:04pm UTC](https://discourse.aurelia.io/t/why-is-select-multiple-bound-to-string-solved/5506/2 "2024-07-30T13:04:11Z")

</div>

OK, my bad. when `model.bind` is used on `<option>` element array contains numbers, not strings (`number[]`)
