meteor-autoform-select2 icon indicating copy to clipboard operation
meteor-autoform-select2 copied to clipboard

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

Open Wishmitha opened this issue 8 years ago • 0 comments
trafficstars

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

Wishmitha avatar May 10 '17 05:05 Wishmitha