【发布时间】:2016-08-27 03:19:09
【问题描述】:
HTML:
<template name="Dep_Con">
<input disabled={{SBD_Dep_Con}} class="input" value="" type="text"/>
</template>
Js:
Template.registerHelper("SBD_Dep_Con", function() {
var returnval = "n";
const ans = Session.get('chosen')
const product = ProductList.findOne({ product: ans});
console.log("product.dep_con:" + product.department_contact)
if(product.department_contact == "N/A") {return true}
else {return false}
});
我已成功启用/禁用 html 中的输入字段(文本),这取决于使用上述代码的另一个保管箱的值。
问题是当输入字段在启用时被填充然后被禁用时,填充的值仍然存在。当“禁用”状态发生变化时,有没有办法重置输入字段的值?还是我看错了方向(即表单有办法不从禁用的输入字段中检索值)?
【问题讨论】:
标签: meteor