Fixed error during the registration process.
This commit is contained in:
parent
5951b2b41c
commit
1aa449fcc7
2 changed files with 9 additions and 9 deletions
|
@ -356,17 +356,17 @@ function registerVarCheck(id, mode, option) {
|
|||
switch (mode) {
|
||||
case 'confirmpw':
|
||||
option = document.getElementById(option);
|
||||
check = input.getAttribute('value') === option.value;
|
||||
check = input.value === option.value;
|
||||
break;
|
||||
case 'password':
|
||||
check = checkPwdEntropy(input.getAttribute('value'));
|
||||
check = checkPwdEntropy(input.value);
|
||||
break;
|
||||
case 'email':
|
||||
check = Sakura.validateEmail(input.getAttribute('value'));
|
||||
check = Sakura.validateEmail(input.value);
|
||||
break;
|
||||
case 'username':
|
||||
default:
|
||||
check = Sakura.stringLength(input.getAttribute('value'), sakuraVars.minUserLen, sakuraVars.maxUserLen);
|
||||
check = Sakura.stringLength(input.value, sakuraVars.minUserLen, sakuraVars.maxUserLen);
|
||||
break;
|
||||
}
|
||||
if (input.className.indexOf(check ? 'green' : 'red') < 0) {
|
||||
|
|
|
@ -430,27 +430,27 @@ function checkPwdEntropy(pwd: string): boolean {
|
|||
// Check registration variables
|
||||
function registerVarCheck(id: string, mode: string, option: any = null): void {
|
||||
// Get the element we're working with
|
||||
var input: HTMLElement = document.getElementById(id);
|
||||
var input: any = document.getElementById(id);
|
||||
var check: boolean = null;
|
||||
|
||||
// Use the proper mode
|
||||
switch (mode) {
|
||||
case 'confirmpw':
|
||||
option = document.getElementById(option);
|
||||
check = input.getAttribute('value') === option.value;
|
||||
check = input.value === option.value;
|
||||
break;
|
||||
|
||||
case 'password':
|
||||
check = checkPwdEntropy(input.getAttribute('value'));
|
||||
check = checkPwdEntropy(input.value);
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
check = Sakura.validateEmail(input.getAttribute('value'));
|
||||
check = Sakura.validateEmail(input.value);
|
||||
break;
|
||||
|
||||
case 'username':
|
||||
default:
|
||||
check = Sakura.stringLength(input.getAttribute('value'), sakuraVars.minUserLen, sakuraVars.maxUserLen);
|
||||
check = Sakura.stringLength(input.value, sakuraVars.minUserLen, sakuraVars.maxUserLen);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue