]> dev.renevier.net Git - syj.git/blobdiff - public/js/contact.js
contact and login js validation: determines required field automatically
[syj.git] / public / js / contact.js
index 1213e6eb5e9c7ef9f04eb11db339a8a5eb3aef39..e41734110f7ca7426ef60a72459c6ef2048c1147 100644 (file)
@@ -10,12 +10,7 @@ document.observe("dom:loaded", function() {
 
         $$('.error').invoke('remove');
 
-        errorElements = $$('input:not([type="submit"]),textarea').findAll(
-            function(elt) {
-                return (!elt.check(function() {
-                    return !this.value.strip().empty();
-                }, SyjStrings.notEmptyField));
-            });
+        errorElements = this.checkEmptyElements(SyjStrings.notEmptyField);
 
         if (!errorElements.length) {
             control = $("contact_email");