]> dev.renevier.net Git - syj.git/blob - public/js/login.js
25562ed14b3382a02c9a6653a62213acaa068dbe
[syj.git] / public / js / login.js
1 /*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
2     and is published under the AGPL license. */
3
4 document.observe("dom:loaded", function() {
5     var form = $("loginform");
6     form.setfocus();
7
8     form.observe("submit", function(evt) {
9         var loginput = $("login_user");
10         $$('.error').invoke('remove');
11
12         if (!loginput.check(function() { return !this.value.strip().empty(); }, SyjStrings.userEmptyWarn)) {
13             loginput.highlight('#F08080').activate();
14             evt.stop();
15             return;
16         }
17     });
18 });