Updating validation
This commit is contained in:
parent
54b75d7dc1
commit
dd5415cb20
@ -76,7 +76,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onLearn() {
|
function onLearn() {
|
||||||
var keyword = prompt('Input keyword to learn as (alphanumeric, no spaces)');
|
var keyword = prompt('Learn keyword as');
|
||||||
if (keyword === null) {
|
if (keyword === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ function loadDb(params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addKeyword(query, callback) {
|
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 });
|
callback({ keyword: query.keyword, success: false });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user