]> dev.renevier.net Git - syj.git/blob - public/js/login.js
2721840d638d3a17177744ad7300db42c1f37c67
[syj.git] / public / js / login.js
1 /*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
2     and is published under the AGPL license. */
3
4 document.observe("dom:loaded", function() {
5     var form = $("loginform");
6     form.focus();
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').focus();
14             loginput.select();
15             evt.stop();
16             return;
17         }
18     });
19 });