]> dev.renevier.net Git - syj.git/blobdiff - public/js/account.js
contact and login js validation: determines required field automatically
[syj.git] / public / js / account.js
index ae4e3ecc213e5645bbddc22aac5a2b8379933864..c19d30ee9abd763a444452884884e49f337f60e7 100644 (file)
@@ -11,13 +11,7 @@ document.observe("dom:loaded", function() {
 
         $$('.error').invoke('remove');
 
-        errorElements = $$('#account_email, #account_password').findAll(
-            function(elt) {
-                return (!elt.check(function() {
-                    return !this.value.strip().empty();
-                }, SyjStrings.notEmptyField));
-            });
-
+        errorElements = this.checkEmptyElements(SyjStrings.notEmptyField);
 
         if (!errorElements.length) {
             control = $("account_password");