X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=public%2Fjs%2Fnewpwd.js;h=9faf70b5f103c787fa76f4e3f2080fa7a296d6aa;hb=c06c7fd6e6f26d31abb8d7c9a9f9e3f2d5b27d5c;hp=5dc898fb9ba5389fa2a8fa17cef2496d0f00daf0;hpb=190fd621df4920c56a422c03663874cddaa67d64;p=syj.git diff --git a/public/js/newpwd.js b/public/js/newpwd.js index 5dc898f..9faf70b 100644 --- a/public/js/newpwd.js +++ b/public/js/newpwd.js @@ -1,5 +1,8 @@ -/* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier, +/* This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier, and is published under the AGPL license. */ + +"use strict"; + function insertErrorBefore(elt, messageError) { var message = new Element("div", {className: 'error'}).update(messageError); elt.insert({before: message}); @@ -16,16 +19,14 @@ document.observe("dom:loaded", function() { tofocus = $$('form input:not([readonly],[disabled])')[0]; } if (tofocus) { - tofocus.focus(); - tofocus.select(); + tofocus.activate(); } $("newpwdform").observe('submit', function(evt) { $$('.error').invoke('remove'); if ($('newpwd_email').value.strip().empty()) { insertErrorBefore($('newpwdform').select('table')[0], SyjStrings.notEmptyField); - $('newpwd_email').focus(); - $('newpwd_email').select(); + $('newpwd_email').highlight('#F08080').activate(); evt.stop(); } });