From a69e9babb44fe14d75cf3d91011c5744183b8f16 Mon Sep 17 00:00:00 2001 From: echicken <> Date: Tue, 16 Aug 2011 00:45:08 +0000 Subject: [PATCH] Cosmetic changes. --- web/root/ecWeb/lib/clientLib.js | 60 ++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/web/root/ecWeb/lib/clientLib.js b/web/root/ecWeb/lib/clientLib.js index 77b0e6c59c..658dc336bc 100644 --- a/web/root/ecWeb/lib/clientLib.js +++ b/web/root/ecWeb/lib/clientLib.js @@ -65,83 +65,92 @@ function validateNewUserForm() { for(e in theForm.elements) { if(theForm.elements[e].id == 'alias') { if(theForm.elements[e].value.length < 1) { - theForm.elements[e].style.backgroundColor = '#FF9999'; + theForm.elements[e].style.backgroundColor = '#660000'; document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; returnValue = false; } else { - theForm.elements[e].style.backgroundColor = '#CCFFCC'; + theForm.elements[e].style.backgroundColor = '#003300'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = ''; } } if(theForm.elements[e].id == 'password1') { if(theForm.elements[e].value.length < 4) { - theForm.elements[e].style.backgroundColor = '#FF9999'; + theForm.elements[e].style.backgroundColor = '#660000'; document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; } else { - theForm.elements[e].style.backgroundColor = '#CCFFCC'; + theForm.elements[e].style.backgroundColor = '#003300'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = ''; } } if(theForm.elements[e].id == 'password2') { if(theForm.elements[e].value != theForm.password1.value) { - theForm.elements[e].style.backgroundColor = '#FF9999'; + theForm.elements[e].style.backgroundColor = '#660000'; document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Password mismatch'; } else { - theForm.elements[e].style.backgroundColor = '#CCFFCC'; + theForm.elements[e].style.backgroundColor = '#003300'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = ''; } } if(theForm.elements[e].id == 'realName') { if(theForm.elements[e].value.length < 1) { - theForm.elements[e].style.backgroundColor = '#FF9999'; + theForm.elements[e].style.backgroundColor = '#660000'; document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; returnValue = false; } else { - theForm.elements[e].style.backgroundColor = '#CCFFCC'; + theForm.elements[e].style.backgroundColor = '#003300'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = ''; } } if(theForm.elements[e].id == 'location') { if(theForm.elements[e].value.length < 1) { - theForm.elements[e].style.backgroundColor = '#FF9999'; + theForm.elements[e].style.backgroundColor = '#660000'; document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; returnValue = false; } else { - theForm.elements[e].style.backgroundColor = '#CCFFCC'; + theForm.elements[e].style.backgroundColor = '#003300'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = ''; } } if(theForm.elements[e].id == 'handle') { if(theForm.elements[e].value.length < 1) { - theForm.elements[e].style.backgroundColor = '#FF9999'; + theForm.elements[e].style.backgroundColor = '#660000'; document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; returnValue = false; } else { - theForm.elements[e].style.backgroundColor = '#CCFFCC'; + theForm.elements[e].style.backgroundColor = '#003300'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = ''; } } if(theForm.elements[e].id == 'streetAddress') { if(theForm.elements[e].value.length < 6) { - theForm.elements[e].style.backgroundColor = '#FF9999'; + theForm.elements[e].style.backgroundColor = '#660000'; document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; returnValue = false; } else { - theForm.elements[e].style.backgroundColor = '#CCFFCC'; + theForm.elements[e].style.backgroundColor = '#003300'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = ''; } } if(theForm.elements[e].id == 'phone') { if(theForm.elements[e].value.length < 1) { - theForm.elements[e].style.backgroundColor = '#FF9999'; + theForm.elements[e].style.backgroundColor = '#660000'; document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; returnValue = false; } else { - theForm.elements[e].style.backgroundColor = '#CCFFCC'; + theForm.elements[e].style.backgroundColor = '#003300'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = ''; } } if(theForm.elements[e].id == 'computer') { if(theForm.elements[e].value.length < 1) { - theForm.elements[e].style.backgroundColor = '#FF9999'; + theForm.elements[e].style.backgroundColor = '#660000'; document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; returnValue = false; } else { - theForm.elements[e].style.backgroundColor = '#CCFFCC'; + theForm.elements[e].style.backgroundColor = '#003300'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = ''; } } if(theForm.elements[e].id == 'sex') { @@ -149,29 +158,32 @@ function validateNewUserForm() { } if(theForm.elements[e].id == 'birthDate') { if(theForm.elements[e].value.match(/\d\d-\d\d-\d\d/) == null) { - theForm.elements[e].style.backgroundColor = '#FF9999'; + theForm.elements[e].style.backgroundColor = '#660000'; document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Invalid date (DD-MM-YY)'; returnValue = false; } else { - theForm.elements[e].style.backgroundColor = '#CCFFCC'; + theForm.elements[e].style.backgroundColor = '#003300'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = ''; } } if(theForm.elements[e].id == 'company') { if(theForm.elements[e].value.length < 1) { - theForm.elements[e].style.backgroundColor = '#FF9999'; + theForm.elements[e].style.backgroundColor = '#660000'; document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; returnValue = false; } else { - theForm.elements[e].style.backgroundColor = '#CCFFCC'; + theForm.elements[e].style.backgroundColor = '#003300'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = ''; } } if(theForm.elements[e].id == 'netmail') { if(theForm.elements[e].value.length < 5) { - theForm.elements[e].style.backgroundColor = '#FF9999'; + theForm.elements[e].style.backgroundColor = '#660000'; document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; returnValue = false; } else { - theForm.elements[e].style.backgroundColor = '#CCFFCC'; + theForm.elements[e].style.backgroundColor = '#003300'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = ''; } } } -- GitLab