Skip to content

Value of the selected option is not saved in the collection. #73

Description

@Wishmitha

I created a field of a schema (CollectionTest) as follows.

year: {
        type: String,
        label: "Year",
        autoform:{
            type:'select2',
            options:function () {

                return[{label:"2013",value:3102},{label:"2014",value:4102},{label:"2015",value:5102}]

            }
        }
    }

When I submit the autoform, it is inserted to the collection. But regardless of the selected option of the year, the year field is always saved as "2013" (which is not even a value).

collectionTest 
{
"_id" : "iysowN69pKWJeajDa",
"year" : "2013"
}

But when I change the 'select2' to 'select' it works fine. But I need to implement the 'select2' because the year field should be searchable.

And I imported following packages before implementing select2 field.

aldeed:autoform-select2
natestrauser:select2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions