【发布时间】:2015-04-07 00:47:59
【问题描述】:
我试图阻止在我的 Meteor 应用程序模板内的用户名字段中复制和粘贴空格,但我总是收到如下所示的错误,有人可以告诉我我做错了什么/缺少什么吗?还有其他的吗如何控制粘贴在 Meteor 模板中的文本字段中的内容?谢谢
Template.UserRegisteration.events({
'input #username':function(e,t){
this.value = this.value.replace(/\s/g,'');
}
});
错误:
Uncaught TypeError: Cannot read property 'replace' of undefined
【问题讨论】:
标签: meteor meteor-blaze