【发布时间】:2016-08-08 04:29:54
【问题描述】:
我有以下架构:
GuestSchema = new SimpleSchema({
name: {
type: String,
label: 'Name'
}
code: {
type: String,
label: 'Code',
autoValue: function(){
return AutoForm.getFieldValue('name', 'insertGuestForm');
},
autoform: {
type: 'hidden'
}
}
});
<template name="NewGuest">
<div class="new-guest">
{{> quickForm collection="Guests" id="insertGuestForm" type="insert" class="new-guest-form"}}
</div>
</template>
但是AutoForm.getFieldValue 没有按预期工作。我想获取name 的字段值并将其与属性code 一起保存在我的数据库中。
【问题讨论】:
标签: meteor meteor-autoform meteor-collection2