Created
April 27, 2011 14:49
-
-
Save alf/944383 to your computer and use it in GitHub Desktop.
User script to fix enter key during login to Skandiabanken
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @match https://secure.skandiabanken.no/SkbSecure/Authentication/Otp/Default.aspx | |
// @match https://secure.skandiabanken.no/SkbSecure/Authentication/Otp/SmsOtp.aspx | |
// ==/UserScript== | |
var submitOnEnter = function(inputId, linkId) { | |
var input = document.getElementById(inputId); | |
var link = document.getElementById(linkId); | |
if (!input || !link) return; | |
input.onkeydown = function(e) { | |
if (e.which == 13) { | |
document.location = link.href; | |
return false; | |
} | |
return true; | |
} | |
} | |
submitOnEnter('ctl00_MainContentPlaceHolder_boxLogin_txtPassword', 'ctl00_MainContentPlaceHolder_boxLogin_btnLogin'); | |
submitOnEnter('ctl00_MainContentPlaceHolder_boxLogin_txtOpt', 'ctl00_MainContentPlaceHolder_boxLogin_SkbFormButtonForward'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment