Skip to content

Setting selected attribute on options for multiple/remote selects #3366

@andrewtweber

Description

@andrewtweber

On the examples page, Multiple select boxes.
https://select2.github.io/examples.html

As you can see, I've selected both Alaska and Hawaii. So why is the selected attribute not set on the <option> elements for those two options ? How am I supposed to know what is selected when I actually submit the form?

screen shot 2015-05-16 at 10 48 45

Similarly for the remote data, I selected a repository, but the select/select2 option is still set to selected, instead of the new option. Why is the new option not marked as selected ? If I were to submit this form now, the value submitted through POST would be select/select2 instead of the one that's actually selected.

screen shot 2015-05-16 at 10 51 30

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions