Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 更正控制台中的验证错误,但select2 Meteor AutoForm输入字段周围没有红色边框_Javascript_Meteor_Meteor Autoform_Simple Schema - Fatal编程技术网

Javascript 更正控制台中的验证错误,但select2 Meteor AutoForm输入字段周围没有红色边框

Javascript 更正控制台中的验证错误,但select2 Meteor AutoForm输入字段周围没有红色边框,javascript,meteor,meteor-autoform,simple-schema,Javascript,Meteor,Meteor Autoform,Simple Schema,我正在使用带有输入字段的自动表单。我的模式如下所示: Data.attachSchema(new SimpleSchema({ title: { type: String, label: "Title", max: 30 }, users: { type: [String], autoform: { type: "select2", option

我正在使用带有输入字段的自动表单。我的模式如下所示:

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};
                });
            }
        }
    }
}));
需要
标题
,以及
用户
输入字段。如果我提交的表单输入为空,则
标题
输入将显示红色边框,并显示错误。但是,这不适用于
用户
输入字段,即使我可以在控制台中看到正确的错误消息


为什么?

您的用户字段类型似乎是数组。您是否使用与标题相同的语法进行了尝试?能否提供JSFIDLE?你解决过这个问题吗??