1 /* This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
2 and is published under the AGPL license. */
6 function insertErrorBefore(elt, messageError) {
7 var message = new Element("div", {className: 'error'}).update(messageError);
8 elt.insert({before: message});
11 document.observe("dom:loaded", function() {
14 errors = $$('.error');
17 tofocus = $('newpwd_email');
19 tofocus = $$('form input:not([readonly],[disabled])')[0];
25 $("newpwdform").observe('submit', function(evt) {
26 $$('.error').invoke('remove');
27 if ($('newpwd_email').value.strip().empty()) {
28 insertErrorBefore($('newpwdform').select('table')[0], SyjStrings.notEmptyField);
29 $('newpwd_email').highlight('#F08080').activate();