]> dev.renevier.net Git - syj.git/blobdiff - public/js/contact.js
allow anonymous routes creation
[syj.git] / public / js / contact.js
index 2f47875e5c74193cb32cbef8bf950eaf4d07c072..416d7457f4c9fb54b6c5e494410b7e853739b985 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");
@@ -30,8 +25,7 @@ document.observe("dom:loaded", function() {
          * if there are errors, cancel submission
          */
         if (errorElements.length) {
-            errorElements[0].focus();
-            errorElements[0].select();
+            errorElements[0].highlight('#F08080').activate();
             evt.stop();
         }
     });