1

Updating validation

This commit is contained in:
Alex Yatskov 2014-11-10 19:45:07 +09:00
parent 54b75d7dc1
commit dd5415cb20
2 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@
}
function onLearn() {
var keyword = prompt('Input keyword to learn as (alphanumeric, no spaces)');
var keyword = prompt('Learn keyword as');
if (keyword === null) {
return;
}

View File

@ -133,7 +133,7 @@ function loadDb(params) {
}
function addKeyword(query, callback) {
if (!/^[a-zA-Z0-9]+$/.test(query.keyword)) {
if (!/^[a-zA-Z0-9\s\-]+$/.test(query.keyword)) {
callback({ keyword: query.keyword, success: false });
return;
}