0
我試圖禁用我的用戶輸入,所以他們不能使用特殊字符,我試過尋找解決方案,但無法找到任何。Knockout JS特殊字符驗證
e.g我不希望我的克林特能夠在輸入框中輸入以下字符:{!{@#$%^ * &()_ + =}}
請幫助。
這是我當前的代碼
self.modelView = {
Id: ko.observable(),
Name: ko.observable().extend({
required: true,
minLength: 2,
maxLength: 25
}),
Address: ko.observable().extend({
required: true,
minLength: 2,
maxLength: 25
})
};
請參閱[this](https://stackoverflow.com/questions/38665159/using-knockout-extender-to-not-allow-an-array-of-characters) – CodingYoshi