meteor-autoform-select2
meteor-autoform-select2 copied to clipboard
Value of the selected option is not saved in the collection.
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