diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/timetrack/unknownuser.html | 10 | ||||
-rw-r--r-- | modules/todo/unknownuser.html | 10 |
2 files changed, 8 insertions, 12 deletions
diff --git a/modules/timetrack/unknownuser.html b/modules/timetrack/unknownuser.html index 8911520..65b6ef3 100644 --- a/modules/timetrack/unknownuser.html +++ b/modules/timetrack/unknownuser.html @@ -47,13 +47,11 @@ function logoutReload(){ function doCreateUser(){ var username=document.getElementById("username").value; var password=document.getElementById("password").value; - var fail; + var fail=false; [["Username",username],["Password",password]].forEach(function(name,value){ - fail=true; - if(value.length<3)alert(name+" too short!"); - else if(value.length>32)alert(name+" too long!"); - else if(!asciiValid(value))alert("Invalid "+name.toLowerCase()+"! Please use only ASCII characters."); - else fail=false; + if(value.length<3){fail=true;alert(name+" too short!");} + else if(value.length>32){fail=true;alert(name+" too long!");} + else if(!asciiValid(value)){fail=true;alert("Invalid "+name.toLowerCase()+"! Please use only ASCII characters.");} }); if(fail)return; diff --git a/modules/todo/unknownuser.html b/modules/todo/unknownuser.html index 4e4a366..afc0d84 100644 --- a/modules/todo/unknownuser.html +++ b/modules/todo/unknownuser.html @@ -47,13 +47,11 @@ function logoutReload(){ function doCreateUser(){ var username=document.getElementById("username").value; var password=document.getElementById("password").value; - var fail; + var fail=false; [["Username",username],["Password",password]].forEach(function(name,value){ - fail=true; - if(value.length<3)alert(name+" too short!"); - else if(value.length>32)alert(name+" too long!"); - else if(!asciiValid(value))alert("Invalid "+name.toLowerCase()+"! Please use only ASCII characters."); - else fail=false; + if(value.length<3){fail=true;alert(name+" too short!");} + else if(value.length>32){fail=true;alert(name+" too long!");} + else if(!asciiValid(value)){fail=true;alert("Invalid "+name.toLowerCase()+"! Please use only ASCII characters.");} }); if(fail)return; |