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