Simpleschema defaultvalue with allowedvalue together


#1

hello , i have the following field in my simpleschema

title: {
type: String,
defaultValue: function () {
return (EmployeesJobs.find({}).map(function (obj) {
return obj.title[obj.title.length - 1].title;
}));
}
},

how can i add the allowedvalue to this field , i did achieve that when i have a dropdownlist like this one
fullName: {
type: String,
allowedValues: function () {
return Meteor.users.find().map(function (obj) {
return obj._id;
})
},
autoform: {
firstOption: false,
options: function () {
return Meteor.users.find({_id: Meteor.userId()}).map(function (obj) {
return {
label: obj.profile.firstname + ’ ’ + obj.profile.middlename + ’ ’ + obj.profile.lastname,
value: obj._id
};
})
}
}
},

but for a straight forward input field i need ur advice