JS: Change to submit behavior: allowed keycode 13 (enter) for submit
authorDan
Fri, 17 Jul 2009 14:05:50 -0400
changeset 23 4b868c7c241e
parent 22 9b8688df52d5
child 24 ba1a31f16afe
child 26 0dac837643a4
JS: Change to submit behavior: allowed keycode 13 (enter) for submit
plugins/yubikey/yubikey.js
--- a/plugins/yubikey/yubikey.js	Sat May 16 18:24:45 2009 -0400
+++ b/plugins/yubikey/yubikey.js	Fri Jul 17 14:05:50 2009 -0400
@@ -55,7 +55,12 @@
           window.clearInterval(yk_interval);
           miniPromptDestroy(this);
         }
-        else if ( this.value.length >= 44 && !this.submitted )
+        else if ( this.value.length == 44 && !this.submitted )
+        {
+          this.submitted = true;
+          yk_handle_submit(this);
+        }
+        else if ( e.keyCode == 13 && this.value.length != 44 )
         {
           this.submitted = true;
           yk_handle_submit(this);