1 /* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
2 and is published under the AGPL license. */
3 Element.addMethods('form', {
4 focus: function(form) {
8 error = form.down('.error');
10 tofocus = error.previous('input,textarea');
12 tofocus = form.down('input:not([readonly],[disabled]),textarea:not([readonly][disabled])');
21 Element.addMethods(['input', 'textarea'], {
22 check: function(control, callback, errorMessage) {
23 if (callback.call(control)) {
29 after: new Element("div", {className: 'error'}).update(errorMessage)