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?你解决过这个问题吗??