X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=public%2Fjs%2Fcontact.js;h=416d7457f4c9fb54b6c5e494410b7e853739b985;hb=a64d41557a62ec6051d7fa08d1ba941e089aa5c2;hp=1213e6eb5e9c7ef9f04eb11db339a8a5eb3aef39;hpb=9efd079d59d269811abc4c551b2f39ab2e6a05fb;p=syj.git diff --git a/public/js/contact.js b/public/js/contact.js index 1213e6e..416d745 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,8 +25,7 @@ document.observe("dom:loaded", function() { * if there are errors, cancel submission */ if (errorElements.length) { - errorElements[0].highlight('#F08080').focus(); - errorElements[0].select(); + errorElements[0].highlight('#F08080').activate(); evt.stop(); } });