2

I am using an AutoForm with a meteor-autoform-select2 input field. My Schema looks like this:

Data.attachSchema(new SimpleSchema({
    title: {
        type: String,
        label: "Title",
        max: 30
    },
    users: {
        type: [String],
        autoform: {
            type: "select2",
            options: function () {
                return Users.find({_id: {$ne: Meteor.userId()}}).map(function (user) {
                    return {label: user.username, value: user._id};
                });
            }
        }
    }
}));

The title, as well as the users input field is required. If I submit my form with empty input, the title input gets a red border and an error appears. However, this does not apply to the users input field, even though I can see the correct error message in my console.

Why?

user3475602
  • 1,217
  • 2
  • 21
  • 43

0 Answers0