X-Git-Url: https://dev.renevier.net/gitweb.cgi?a=blobdiff_plain;f=public%2Fjs%2Fcontact.js;h=e41734110f7ca7426ef60a72459c6ef2048c1147;hb=4360d632b91c3e17a776bc9308eba3a3915f7005;hp=2f47875e5c74193cb32cbef8bf950eaf4d07c072;hpb=190fd621df4920c56a422c03663874cddaa67d64;p=syj.git diff --git a/public/js/contact.js b/public/js/contact.js index 2f47875..e417341 100644 --- a/public/js/contact.js +++ b/public/js/contact.js @@ -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,7 +25,7 @@ document.observe("dom:loaded", function() { * if there are errors, cancel submission */ if (errorElements.length) { - errorElements[0].focus(); + errorElements[0].highlight('#F08080').focus(); errorElements[0].select(); evt.stop(); }