]> dev.renevier.net Git - syj.git/blobdiff - public/js/login.js
highlight for input on errors
[syj.git] / public / js / login.js
index 44d8e080734c868b8a02137aed5658e94f105ed3..2721840d638d3a17177744ad7300db42c1f37c67 100644 (file)
@@ -6,9 +6,12 @@ document.observe("dom:loaded", function() {
     form.focus();
 
     form.observe("submit", function(evt) {
+        var loginput = $("login_user");
         $$('.error').invoke('remove');
 
-        if (!$("login_user").check(function() { return !this.value.strip().empty(); }, SyjStrings.userEmptyWarn)) {
+        if (!loginput.check(function() { return !this.value.strip().empty(); }, SyjStrings.userEmptyWarn)) {
+            loginput.highlight('#F08080').focus();
+            loginput.select();
             evt.stop();
             return;
         }