【发布时间】:2017-01-05 01:06:11
【问题描述】:
我正在尝试获取已选为 true 的每个复选框的值。每次我选择一个复选框时,它都会获取该复选框的值,而不是所有选定的复选框。
路径:talentList.html
<fieldset>
<div class="checkbox">
<label>
<input name="specialisation" type="checkbox" value="Accounting Firm"> Accounting Firm
</label>
</div>
<div class="checkbox">
<label>
<input name="specialisation" type="checkbox" value="Accounting in Industry"> Accounting in Industry
</label>
</div>
</fieldset>
路径:talentList.js
Template.talentList.events({
'change [name="specialisation"]': function ( event, template ) {
let specialisation = event.target.value;
template.candidateListFilter.set( specialisation );
}
});
【问题讨论】:
-
我不清楚你的问题是什么。每当您选择一个复选框时,您是否试图获取所有选定的复选框值?
-
是的,没错
标签: meteor meteor-blaze