installer: fixed validation

v1.18.x
psychobunny 10 years ago
parent 2646b38dd2
commit 213ee2d063

@ -31,10 +31,13 @@ $('document').ready(function() {
help = parent.children('.help-text');
function validateUsername(field) {
console.log('derp');
if (!utils.isUserNameValid(field) || !utils.slugify(field)) {
console.log('derp1');
parent.addClass('error');
help.html('Invalid Username.');
} else {
console.log('derp2');
parent.removeClass('error');
}
}
@ -72,13 +75,13 @@ $('document').ready(function() {
}
switch (type) {
case 'username':
case 'admin:username':
return validateUsername(field);
case 'password':
case 'admin:password':
return validatePassword(field);
case 'confirm':
case 'admin:confirm':
return validateConfirmPassword(field);
case 'email':
case 'admin:email':
return validateEmail(field);
case 'database':
return switchDatabase(field);

Loading…
Cancel
Save