From: Art Cancro Date: Tue, 18 Jan 2011 22:18:14 +0000 (-0500) Subject: Enter/return key submits form in the new user/password dialog X-Git-Tag: v8.11~899 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=f2834d7bf763a451d95354f52f5bc38d2c97c36f Enter/return key submits form in the new user/password dialog --- diff --git a/webcit/static/authmethods.js b/webcit/static/authmethods.js index 67018a7c2..4bb117c61 100644 --- a/webcit/static/authmethods.js +++ b/webcit/static/authmethods.js @@ -66,6 +66,23 @@ function ajax_try_username_and_password() { }); } +/* + * The user pressed a key while in the username or password box. + * Is it the enter/return key? Submit the form. + */ +function username_and_password_onkeypress(e) { + if (window.event) { /* IE */ + keynum = e.keyCode + } + else if (e.which) { /* real browsers */ + keynum = e.which + } + if (keynum == 13) { /* enter/return key */ + ajax_try_username_and_password(); + } +} + + /* * tab handler for the login box */ diff --git a/webcit/static/t/get_logged_in.html b/webcit/static/t/get_logged_in.html index 3648eee17..568f4c186 100644 --- a/webcit/static/t/get_logged_in.html +++ b/webcit/static/t/get_logged_in.html @@ -39,10 +39,10 @@

- +

- +